Last active
November 16, 2016 20:13
-
-
Save linusnorton/32abdaa51058e768175a3163ff8d9921 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (const [stoppingPattern, trips] of tripsByStoppingPattern) { | |
const lines = linesByStoppingPattern.get(stoppingPattern, []); | |
for (const trip of trips) { | |
this.getLineForTrip(trip, lines).match({ | |
some: line => line.add(trip), | |
none: () => lines.push(new Line([trip])) | |
}); | |
linesByStoppingPattern = linesByStoppingPattern.set(stoppingPattern, lines); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment