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:
parent
27c4720328
commit
f79f49b0f6
1 changed files with 1 additions and 1 deletions
|
@ -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)!);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue