]> granicus.if.org Git - graphviz/commitdiff
neatogen addCorners: use a clearer iteration idiom
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 20 Nov 2022 00:20:18 +0000 (16:20 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 25 Nov 2022 18:33:31 +0000 (10:33 -0800)
lib/neatogen/adjust.c

index 3fa7966f3fad83bb258da5b8466f6778c151a223..c39d8309b7486892baf661aeadbe0850d13d25de 100644 (file)
@@ -416,8 +416,8 @@ static void addCorners(void)
     double ned = dist_2(&ip->site.coord, &ne);
     double d;
 
-    ip++;
     for (size_t i = 1; i < nsites; i++) {
+       ip = &nodeInfo[i];
        d = dist_2(&ip->site.coord, &sw);
        if (d < swd) {
            swd = d;
@@ -438,7 +438,6 @@ static void addCorners(void)
            ned = d;
            nes = ip;
        }
-       ip++;
     }
 
     addVertex(&sws->site, sw.x, sw.y);