]> granicus.if.org Git - graphviz/commitdiff
abbreviate an open coded fmin in getEdgeList
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 18 Jun 2021 01:17:21 +0000 (18:17 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 19 Jun 2021 20:28:10 +0000 (13:28 -0700)
lib/fdpgen/layout.c

index 19a449cde31ae8263481f63e4673b820b1d87a9e..2fc54812d6f0360049fbc61892216789531cb6e9 100644 (file)
@@ -33,6 +33,7 @@
 #include <inttypes.h>
 #include <assert.h>
 #include <fdpgen/tlayout.h>
+#include <math.h>
 #include <neatogen/neatoprocs.h>
 #include <neatogen/adjust.h>
 #include <fdpgen/comp.h>
@@ -627,9 +628,7 @@ static erec *getEdgeList(node_t * n, graph_t * g)
                    bnd = M_PI; /* all values equal up to end */
                else
                    bnd = erecs[j].alpha;
-               delta = (bnd - a) / (j - i);
-               if (delta > ANG)
-                   delta = ANG;
+               delta = fmin((bnd - a) / (j - i), ANG);
                inc = 0;
                for (; i < j; i++) {
                    erecs[i].alpha += inc;