From e65e3995b0dc0a8e1d36e4f71a29e284a943c402 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 19 Sep 2021 16:26:39 -0700 Subject: [PATCH] tclpathplan.c: rephrase open coded fmax/fmin --- tclpkg/tclpathplan/tclpathplan.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tclpkg/tclpathplan/tclpathplan.c b/tclpkg/tclpathplan/tclpathplan.c index 80dab6d79..0020fc51e 100644 --- a/tclpkg/tclpathplan/tclpathplan.c +++ b/tclpkg/tclpathplan/tclpathplan.c @@ -705,14 +705,10 @@ vgpanecmd(ClientData clientData, Tcl_Interp * interp, int argc, LL = UR = pp.ps[0]; for (j = 1; j < pp.pn; j++) { p = pp.ps[j]; - if (p.x > UR.x) - UR.x = p.x; - if (p.y > UR.y) - UR.y = p.y; - if (p.x < LL.x) - LL.x = p.x; - if (p.y < LL.y) - LL.y = p.y; + UR.x = fmax(UR.x, p.x); + UR.y = fmax(UR.y, p.y); + LL.x = fmin(LL.x, p.x); + LL.y = fmin(LL.y, p.y); } appendpoint(interp, LL); appendpoint(interp, UR); -- 2.40.0