(Trivial) do not continue pathfinder when the destination is reached

master
y5nw 2021-08-23 14:59:31 +02:00
parent 8d8bfacb75
commit 031d94fb4f
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@
(loop with contp = t while (and (> (hash-table-count unknown) 0) contp)
do (multiple-value-bind (u d) (shortest-unseen)
(remhash u unknown)
(if (>= d most-positive-fixnum)
(if (or (>= d most-positive-fixnum) (equalp u to))
(setf contp nil)
(loop for (v . len) in (direct-next tdb u t) for alt = (+ d len)
when (< alt (gethash v dist)) do