From: Matthew Fernandez Date: Fri, 19 Mar 2021 04:48:52 +0000 (-0700) Subject: rephrase unnecessarily cryptic bitwise operations X-Git-Tag: 2.47.1~30^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ce566972844b46a18a29f5895f74cdbab970935b;p=graphviz rephrase unnecessarily cryptic bitwise operations This is just doing boolean logic. Sometimes there is a motivation to use bitwise operators in place of boolean operators to optimize hot paths that are negatively affected by the stalling semantics of boolean shortcut logic. But this is not the case here. This is not a hot path. --- diff --git a/lib/neatogen/edges.c b/lib/neatogen/edges.c index 63c939e0e..805bc760f 100644 --- a/lib/neatogen/edges.c +++ b/lib/neatogen/edges.c @@ -117,7 +117,7 @@ void clip_line(Edge * e) x2 = e->c - e->b * y2; } - if (((x1 > pxmax) & (x2 > pxmax)) | ((x1 < pxmin) & (x2 < pxmin))) + if ((x1 > pxmax && x2 > pxmax) || (x1 < pxmin && x2 < pxmin)) return; if (x1 > pxmax) { x1 = pxmax; @@ -166,7 +166,7 @@ void clip_line(Edge * e) y2 = e->c - e->a * x2; } - if (((y1 > pymax) & (y2 > pymax)) | ((y1 < pymin) & (y2 < pymin))) + if ((y1 > pymax && y2 > pymax) || (y1 < pymin && y2 < pymin)) return; if (y1 > pymax) { y1 = pymax;