Skip to content

Commit

Permalink
simple fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
teijosol committed Jan 15, 2025
1 parent 14bce7c commit 3ac6cf0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ public Map<String, Stop> createStops(final Map<Long, Map<List<LocalDate>, Schedu
});

final Map<String, StationEmbeddable> uniqueStationEmbeddables = new HashMap<>();
for (final Long trainNumber : scheduleIntervalsByTrain.keySet()) {
final Map<List<LocalDate>, Schedule> trainsSchedules = scheduleIntervalsByTrain.get(trainNumber);
for (final Map<List<LocalDate>, Schedule> trainsSchedules : scheduleIntervalsByTrain.values()) {
for (final List<LocalDate> localDates : trainsSchedules.keySet()) {
final Schedule schedule = trainsSchedules.get(localDates);
for (final ScheduleRow scheduleRow : schedule.scheduleRows) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ private List<StopTime> createStopTimes(final Schedule schedule, final String tri
stopTimes.add(stopTime);
}

stopTimes.get(0).dropoffType = 1;
stopTimes.getFirst().dropoffType = 1;
Iterables.getLast(stopTimes).pickupType = 1;

return stopTimes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public Optional<InfraApiPlatform> getStationPlatform(final String stationShortCo
}

public boolean isValidTrack(final String stationShortCode, final String track) {
return validTracksByStation.getOrDefault(stationShortCode, Collections.emptySet()).contains(track);
final var stationTracks = validTracksByStation.get(stationShortCode);

return stationTracks != null && stationTracks.contains(track);
}
}

0 comments on commit 3ac6cf0

Please sign in to comment.