]> granicus.if.org Git - graphviz/commitdiff
remove a micro-optimization in checkpath
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 26 Jun 2021 03:11:49 +0000 (20:11 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 30 Jun 2021 02:32:59 +0000 (19:32 -0700)
Self-stores like this are effectively free on a modern CPU. The branch guarding
this store is more costly than the store itself.

lib/common/routespl.c

index 2b0bd53741c4cf9d26d6aeeaed91ad989f589322..3e9e8e1faeaf7c4b02bdd070dc9c833dd6b7e5f0 100644 (file)
@@ -668,8 +668,7 @@ static int checkpath(int boxn, boxf* boxes, path* thepath)
            continue;
        if (fabs(boxes[bi].LL.x - boxes[bi].UR.x) < .01)
            continue;
-       if (i != bi)
-           boxes[i] = boxes[bi];
+       boxes[i] = boxes[bi];
        i++;
     }
     boxn = i;