From: Matthew Fernandez Date: Sat, 4 Sep 2021 01:23:05 +0000 (-0700) Subject: fullArea: remove micro-optimization of 0 value of 'm' X-Git-Tag: 2.49.1~27^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2147a2d3e647be93bb63ba8fe566a82a914f54cf;p=graphviz 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. --- 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)