From 2147a2d3e647be93bb63ba8fe566a82a914f54cf Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Fri, 3 Sep 2021 18:23:05 -0700 Subject: [PATCH] fullArea: remove micro-optimization of 0 value of 'm' This is no longer necessary on modern compilers/processors where square root is less expensive and this code is not on a hot path. --- lib/patchwork/patchwork.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/patchwork/patchwork.c b/lib/patchwork/patchwork.c index 95ce3e0b8..fb3d20101 100644 --- a/lib/patchwork/patchwork.c +++ b/lib/patchwork/patchwork.c @@ -52,11 +52,8 @@ void dumpTree (treenode_t* r, int ind) static double fullArea (treenode_t* p, attrsym_t* mp) { double m = late_double (p->u.subg, mp, 0, 0); - if (m == 0) return p->child_area; - else { - double wid = (2.0*m + sqrt(p->child_area)); - return wid*wid; - } + double wid = 2.0 * m + sqrt(p->child_area); + return wid * wid; } static double getArea (void* obj, attrsym_t* ap) -- 2.40.0