fix bug with value inserted into ValSet: before, the value inserted into the 'from' field was the ID of the current platform, but this is incorrect as it is circular. To fix, the 'from' field now contains the ID of the previous platform which this platform was found from

This commit is contained in:
2025-01-20 11:17:00 +00:00
parent 9c46e09ce4
commit 4e5219fccc
3 changed files with 28 additions and 18 deletions

View File

@@ -133,11 +133,11 @@ end
structure DistHeap =
MakeSkewHeap
(struct
type t = {distance: int, id: int}
type t = {distance: int, id: int, comesFrom: int}
type id = int
(* default = defaultID returned when queue is empty *)
val default = {distance = ~1, id = ~1}
val default = {distance = ~1, id = ~1, comesFrom = ~1}
fun getID {id, distance = _} = id