abbreviate open coded fmax/fmin in limitBoxes
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 31 May 2021 16:20:41 +0000 (09:20 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 6 Jun 2021 18:06:37 +0000 (11:06 -0700)
lib/common/routespl.c

index 6c6f6846b9ccff3f32eb29a72ee4f72ad98ca30f..295461d80d11ea8f80469188cde73eb9555398a8 100644 (file)
@@ -346,10 +346,8 @@ limitBoxes (boxf* boxes, int boxn, const pointf *pps, int pn, int delta)
  *     or graphs/directed/records.gv fails */
 #define FUDGE .0001
                if (sp[0].y <= boxes[bi].UR.y+FUDGE && sp[0].y >= boxes[bi].LL.y-FUDGE) {
-                   if (boxes[bi].LL.x > sp[0].x)
-                       boxes[bi].LL.x = sp[0].x;
-                   if (boxes[bi].UR.x < sp[0].x)
-                       boxes[bi].UR.x = sp[0].x;
+                   boxes[bi].LL.x = fmin(boxes[bi].LL.x, sp[0].x);
+                   boxes[bi].UR.x = fmax(boxes[bi].UR.x, sp[0].x);
                }
            }
        }