Skip to content

Commit

Permalink
gtfs loader: make time monotonic increasing
Browse files Browse the repository at this point in the history
  • Loading branch information
felixguendling committed Dec 7, 2024
1 parent 23e6197 commit 815bd0c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/loader/gtfs/load_timetable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ void load_timetable(loader_config const& config,
sort_by(t.seq_numbers_, t.stop_seq_, t.event_times_,
t.stop_headsigns_, t.distance_traveled_);
}

auto pred = minutes_after_midnight_t{0U};
for (auto& [arr, dep] : t.event_times_) {
arr = std::max(pred, arr);
dep = std::max(arr, dep);
pred = dep;
}
}
}

Expand Down

0 comments on commit 815bd0c

Please sign in to comment.