]> granicus.if.org Git - graphviz/commitdiff
neatogen bbox: abbreviate some open coded 'fmax', 'fmin'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 18 Nov 2022 02:11:33 +0000 (18:11 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 19 Nov 2022 05:29:08 +0000 (21:29 -0800)
lib/neatogen/multispline.c

index 79c40fc2bce4acbbeb6b0866a8e72fdfddf9f4b1..ba5f768d2d37c970364bb205558b09604f982258 100644 (file)
@@ -453,14 +453,10 @@ static boxf bbox(Ppoly_t** obsp, int npoly, int *np)
        obs = *obsp++;
        for (j = 0; j < obs->pn; j++) {
            p = obs->ps[j];
-           if (p.x < bb.LL.x)
-               bb.LL.x = p.x;
-           if (p.x > bb.UR.x)
-               bb.UR.x = p.x;
-           if (p.y < bb.LL.y)
-               bb.LL.y = p.y;
-           if (p.y > bb.UR.y)
-               bb.UR.y = p.y;
+           bb.LL.x = fmin(bb.LL.x, p.x);
+           bb.UR.x = fmax(bb.UR.x, p.x);
+           bb.LL.y = fmin(bb.LL.y, p.y);
+           bb.UR.y = fmax(bb.UR.y, p.y);
            cnt++;
        }
     }