Skip to content

Commit 1e39663

Browse files
author
MannyC
committed
remove superfluous code from closest
1 parent 67850cc commit 1e39663

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

astar.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ var astar = {
6060

6161
// set the start node to be the closest if required
6262
var closestNode = start;
63-
if(closest){
64-
start.h = start.h || heuristic(start.pos, end.pos, costStraight, costDiagonal);
65-
}
63+
64+
start.h = heuristic(start.pos, end.pos, costStraight, costDiagonal);
6665

6766
function pathTo( node ){
6867
var curr = node;

0 commit comments

Comments
 (0)