]> granicus.if.org Git - graphviz/commitdiff
expandBB: rephrase open coding to fmax, fmin
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 30 Aug 2021 00:28:41 +0000 (17:28 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 4 Sep 2021 02:31:58 +0000 (19:31 -0700)
lib/common/emit.c

index 48e9204423fd078da9ad2f6eb66f5c1a3cab7af1..4c513f4076f7eedcf72585d4de246236000aacac 100644 (file)
@@ -2874,14 +2874,10 @@ static char adjust[] = {'l', 'n', 'r'};
 static void
 expandBB (boxf* bb, pointf p)
 {
-    if (p.x > bb->UR.x)
-       bb->UR.x = p.x;
-    if (p.x < bb->LL.x)
-       bb->LL.x = p.x;
-    if (p.y > bb->UR.y)
-       bb->UR.y = p.y;
-    if (p.y < bb->LL.y)
-       bb->LL.y = p.y;
+    bb->UR.x = fmax(bb->UR.x, p.x);
+    bb->LL.x = fmin(bb->LL.x, p.x);
+    bb->UR.y = fmax(bb->UR.y, p.y);
+    bb->LL.y = fmin(bb->LL.y, p.y);
 }
 
 static boxf