]> granicus.if.org Git - graphviz/commitdiff
tclpathplan.c: rephrase open coded fmax/fmin
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 19 Sep 2021 23:26:39 +0000 (16:26 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 25 Sep 2021 17:23:22 +0000 (10:23 -0700)
tclpkg/tclpathplan/tclpathplan.c

index 80dab6d7995d1011633329b859d098157f8406bd..0020fc51e65b427ee74b8acfac7574c3afff1f00 100644 (file)
@@ -705,14 +705,10 @@ vgpanecmd(ClientData clientData, Tcl_Interp * interp, int argc,
                LL = UR = pp.ps[0];
                for (j = 1; j < pp.pn; j++) {
                    p = pp.ps[j];
-                   if (p.x > UR.x)
-                       UR.x = p.x;
-                   if (p.y > UR.y)
-                       UR.y = p.y;
-                   if (p.x < LL.x)
-                       LL.x = p.x;
-                   if (p.y < LL.y)
-                       LL.y = p.y;
+                   UR.x = fmax(UR.x, p.x);
+                   UR.y = fmax(UR.y, p.y);
+                   LL.x = fmin(LL.x, p.x);
+                   LL.y = fmin(LL.y, p.y);
                }
                appendpoint(interp, LL);
                appendpoint(interp, UR);