]> granicus.if.org Git - graphviz/commitdiff
replace an open coded hypotenuse calculation in dist with a call to hypot
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 18 Jun 2021 00:56:42 +0000 (17:56 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 19 Jun 2021 20:28:10 +0000 (13:28 -0700)
Similar to the previous commit.

lib/fdpgen/xlayout.c

index 03560fc25cb8d9ff73ca638b775117ea4d8a62c1..fe784a7666c55d4a4af51734dcc83a85d2ac23af 100644 (file)
@@ -118,7 +118,7 @@ static double dist(pointf p, pointf q)
 
     dx = p.x - q.x;
     dy = p.y - q.y;
-    return sqrt(dx * dx + dy * dy);
+    return hypot(dx, dy);
 }
 
 /* bBox: