crucial performance optimization

This commit is contained in:
Leijurv 2019-02-03 19:46:59 -08:00
parent 0e1534613c
commit 5382d265f2
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -153,7 +153,7 @@ public final class AStarPathFinder extends AbstractNodeCostSearch {
if (bestHeuristicSoFar[i] - heuristic > minimumImprovement) {
bestHeuristicSoFar[i] = heuristic;
bestSoFar[i] = neighbor;
if (getDistFromStartSq(neighbor) > MIN_DIST_PATH * MIN_DIST_PATH) {
if (failing && getDistFromStartSq(neighbor) > MIN_DIST_PATH * MIN_DIST_PATH) {
failing = false;
}
}