Fix schedule breaking on 2001-09-09 01:46:40Z

Array.sort() sorts by UTF-16 code points even when the items in the
array are numbers.  Fix the schedule breaking when events cross
different powers of 10 in Unix time which caused the junctions to no
longer be sorted by the numeric value of their Unix time.
This commit is contained in:
Hornwitser 2025-06-29 20:30:39 +02:00
parent 27c4720328
commit f79f49b0f6

View file

@ -226,7 +226,7 @@ function junctionsFromEdges(edges: Iterable<Edge>) {
junctions.set(ts, { ts, edges: [edge] });
}
}
const keys = [...junctions.keys()].sort();
const keys = [...junctions.keys()].sort((a, b) => a - b);
return keys.map(key => junctions.get(key)!);
}