From: Matthew Fernandez Date: Sat, 27 Nov 2021 18:09:04 +0000 (-0800) Subject: gvbisect: [nfc] rephrase an open coded 'fabs' X-Git-Tag: 2.50.0~5^2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=75606b563f4dcc540e55e2bdf4dd370b29b63c66;p=graphviz gvbisect: [nfc] rephrase an open coded 'fabs' --- diff --git a/lib/neatogen/edges.c b/lib/neatogen/edges.c index 533c9d41c..aeb6d9731 100644 --- a/lib/neatogen/edges.c +++ b/lib/neatogen/edges.c @@ -42,8 +42,8 @@ Edge *gvbisect(Site * s1, Site * s2) dx = s2->coord.x - s1->coord.x; dy = s2->coord.y - s1->coord.y; - adx = dx > 0 ? dx : -dx; - ady = dy > 0 ? dy : -dy; + adx = fabs(dx); + ady = fabs(dy); newedge->c = s1->coord.x * dx + s1->coord.y * dy + (dx * dx + dy * dy) * 0.5; if (adx > ady) {