lazy evaluation A* condition

if the first condition is met, no need to iterate the node list
Weight of diagonal nodes in A* algorithm

Diagonal nodes account for a slightly longer distance than an adjacent
node so calculate the distance correctly. Its already done like this in
the other branch of the same if statement.