]> git.pond.sub.org Git - empserver/commitdiff
Speed up A* neighbor cache hits old-astar
authorMarkus Armbruster <armbru@pond.sub.org>
Thu, 24 Feb 2011 18:29:33 +0000 (19:29 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 12 Apr 2011 19:40:08 +0000 (21:40 +0200)
struct sctstr members sct_x, sct_y are normalized, no need to
normalize them again.

The neighbor cache now speeds up distribution path assembly by about
10% without the path cache, and by about 5% with the path cache.

src/lib/common/path.c

index 58fded85820a86dd5c5280b8c188abb1f70c2ae6..7350e3099f2fdf866e880c4942c29e5b3be18a49 100644 (file)
@@ -227,8 +227,8 @@ bp_neighbors(struct as_coord c, struct as_coord *cp, void *pp)
            *ssp = sp;
        } else {
            sp = *ssp;
-           sx = XNORM(sp->sct_x);
-           sy = YNORM(sp->sct_y);
+           sx = sp->sct_x;
+           sy = sp->sct_y;
        }
        /* No need to calculate cost each time, just make sure we can
           move through it.  We calculate it later. */