From: Matthew Fernandez Date: Sun, 20 Nov 2022 00:19:20 +0000 (-0800) Subject: neatogen countOverlap: use a clearer iteration idiom X-Git-Tag: 7.0.3~1^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f792852c55a5880af75304ababe8becdca6a6cd2;p=graphviz neatogen countOverlap: use a clearer iteration idiom --- diff --git a/lib/neatogen/adjust.c b/lib/neatogen/adjust.c index 44336995d..3fa7966f3 100644 --- a/lib/neatogen/adjust.c +++ b/lib/neatogen/adjust.c @@ -306,23 +306,20 @@ static void rmEquality(void) static int countOverlap(int iter) { int count = 0; - Info_t *ip = nodeInfo; - Info_t *jp; for (size_t i = 0; i < nsites; i++) nodeInfo[i].overlaps = 0; for (size_t i = 0; i < nsites - 1; i++) { - jp = ip + 1; + Info_t *ip = &nodeInfo[i]; for (size_t j = i + 1; j < nsites; j++) { + Info_t *jp = &nodeInfo[j]; if (polyOverlap(ip->site.coord, &ip->poly, jp->site.coord, &jp->poly)) { count++; ip->overlaps = 1; jp->overlaps = 1; } - jp++; } - ip++; } if (Verbose > 1)