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

index 900e0090891c4bdaba70097eaff66aa7f4e1825d..fa9177662f44be565d872fe77a2fa8de70507b5f 100644 (file)
@@ -211,12 +211,8 @@ static int overlap(node_t * p, node_t * q)
     double xdelta, ydelta;
     int    ret;
 
-    xdelta = ND_pos(q)[0] - ND_pos(p)[0];
-    if (xdelta < 0)
-       xdelta = -xdelta;
-    ydelta = ND_pos(q)[1] - ND_pos(p)[1];
-    if (ydelta < 0)
-       ydelta = -ydelta;
+    xdelta = fabs(ND_pos(q)[0] - ND_pos(p)[0]);
+    ydelta = fabs(ND_pos(q)[1] - ND_pos(p)[1]);
     ret = xdelta <= WD2(p) + WD2(q) && ydelta <= HT2(p) + HT2(q);
     return ret;
 #else