From 75606b563f4dcc540e55e2bdf4dd370b29b63c66 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 27 Nov 2021 10:09:04 -0800 Subject: [PATCH] gvbisect: [nfc] rephrase an open coded 'fabs' --- lib/neatogen/edges.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) { -- 2.40.0