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:
parent
7edcd3ea77
commit
e882567889
1 changed files with 2 additions and 2 deletions
|
@ -227,8 +227,8 @@ bp_neighbors(struct as_coord c, struct as_coord *cp, void *pp)
|
||||||
*ssp = sp;
|
*ssp = sp;
|
||||||
} else {
|
} else {
|
||||||
sp = *ssp;
|
sp = *ssp;
|
||||||
sx = XNORM(sp->sct_x);
|
sx = sp->sct_x;
|
||||||
sy = YNORM(sp->sct_y);
|
sy = sp->sct_y;
|
||||||
}
|
}
|
||||||
/* No need to calculate cost each time, just make sure we can
|
/* No need to calculate cost each time, just make sure we can
|
||||||
move through it. We calculate it later. */
|
move through it. We calculate it later. */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue