make things faster/cleaner

This commit is contained in:
Stefan Harmuth 2021-12-15 11:49:14 +01:00
parent 11604338e8
commit 072ba02831

View File

@ -209,7 +209,7 @@ class Grid:
openNodes[pos_from] = (0, pos_from.getDistanceTo(pos_to), None) openNodes[pos_from] = (0, pos_from.getDistanceTo(pos_to), None)
heappush(f_costs, (0, pos_from)) heappush(f_costs, (0, pos_from))
while openNodes: while f_costs:
_, currentCoord = heappop(f_costs) _, currentCoord = heappop(f_costs)
if currentCoord not in openNodes: if currentCoord not in openNodes:
continue continue