]> granicus.if.org Git - graphviz/commitdiff
geomUpdate: rephrase and condense some open coded fmax/fmin
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 10 Sep 2021 00:57:07 +0000 (17:57 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 16 Sep 2021 02:56:26 +0000 (19:56 -0700)
lib/neatogen/adjust.c

index d7db933def1a45eb2f0feedc3e111a3ef085408f..489698dd2fe294cc9285c22f5802d61da8ee7bc3 100644 (file)
@@ -236,10 +236,8 @@ static void geomUpdate(int doSort)
     xmin = sites[0]->coord.x;
     xmax = sites[0]->coord.x;
     for (i = 1; i < nsites; i++) {
-       if (sites[i]->coord.x < xmin)
-           xmin = sites[i]->coord.x;
-       if (sites[i]->coord.x > xmax)
-           xmax = sites[i]->coord.x;
+       xmin = fmin(xmin, sites[i]->coord.x);
+       xmax = fmax(xmax, sites[i]->coord.x);
     }
     ymin = sites[0]->coord.y;
     ymax = sites[nsites - 1]->coord.y;