]> granicus.if.org Git - graphviz/commitdiff
newpos: abbreviate some accumulation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 10 Sep 2021 01:01:58 +0000 (18:01 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 16 Sep 2021 02:56:26 +0000 (19:56 -0700)
lib/neatogen/adjust.c

index 935eee634be322b23648f89c6abb52698a4ff7a7..f02760d921866f592d29a13c061c3bed30b55ce1 100644 (file)
@@ -403,9 +403,9 @@ static void newpos(Info_t * ip)
     while (q != NULL) {
        area = areaOf(anchor->p, p->p, q->p);
        centroidOf(anchor->p, p->p, q->p, &x, &y);
-       cx = cx + area * x;
-       cy = cy + area * y;
-       totalArea = totalArea + area;
+       cx += area * x;
+       cy += area * y;
+       totalArea += area;
        p = q;
        q = q->next;
     }