]> granicus.if.org Git - graphviz/commitdiff
circogen setInfo: abbreviate some open coded 'fmax'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 20 Nov 2022 20:11:31 +0000 (12:11 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 24 Nov 2022 22:45:56 +0000 (14:45 -0800)
lib/circogen/circpos.c

index 1d700d2e28d4fa89edcfc30e37179582ac08ae23..828c73bc8541858e70b8e1d11fe18446f1176b52 100644 (file)
@@ -17,6 +17,7 @@
  */
 
 #include       <circogen/blockpath.h>
+#include       <math.h>
 
 /* getRotation:
  * The function determines how much the block should be rotated
@@ -221,13 +222,10 @@ setInfo (posinfo_t* p0, posinfo_t* p1, double delta)
 
     t /= 2*delta*p0->minRadius*p1->minRadius;
 
-    if (t < 1)
-       t = 1;
+    t = fmax(t, 1);
 
-    if (t > p0->scale)
-       p0->scale = t;
-    if (t > p1->scale)
-       p1->scale = t;
+    p0->scale = fmax(p0->scale, t);
+    p1->scale = fmax(p1->scale, t);
 }
 
 /* positionChildren: