(Trivial) do not continue pathfinder when the destination is reached
parent
8d8bfacb75
commit
031d94fb4f
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue