Speed up A* neighbor cache hits

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.
This commit is contained in:
Markus Armbruster 2011-02-24 19:29:33 +01:00
parent 7edcd3ea77
commit e882567889

View 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. */