Skip to content

Commit 4861f1e

Browse files
committed
fix review
1 parent 5f466d3 commit 4861f1e

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

source/time_tables/departure_boards.cpp

+13-7
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,18 @@ static bool is_terminus_for_all_stop_times(const std::vector<routing::datetime_s
6666
return !stop_times.empty();
6767
}
6868

69-
void update_display_information(bool& vj_found,
70-
const std::pair<unsigned int, const navitia::type::StopTime*>& dt_st,
69+
bool update_display_information(bool& vj_found,
70+
const navitia::type::StopTime* st,
7171
pbnavitia::PtDisplayInfo* pt_display_information,
7272
PbCreator& pb_creator) {
73-
if (!vj_found && dt_st.second != nullptr) {
74-
auto vj = dt_st.second->vehicle_journey;
73+
if (!vj_found && st != nullptr) {
74+
const auto* vj = st->vehicle_journey;
7575
pt_display_information->set_trip_short_name(vj->name);
7676
pt_display_information->set_headsign(pb_creator.data->pt_data->headsign_handler.get_headsign(vj));
77-
vj_found = true;
77+
return true;
7878
}
79+
80+
return false;
7981
}
8082

8183
static void fill_date_times(PbCreator& pb_creator,
@@ -148,7 +150,9 @@ static void render(PbCreator& pb_creator,
148150

149151
// Now we fill the date_times
150152
for (auto dt_st : id_vec.second) {
151-
update_display_information(vj_found, dt_st, pt_display_information, pb_creator);
153+
if (!vj_found) {
154+
vj_found = update_display_information(vj_found, dt_st.second, pt_display_information, pb_creator);
155+
}
152156
fill_date_times(pb_creator, schedule, dt_st, calendar_id);
153157
}
154158

@@ -211,7 +215,9 @@ static void render(PbCreator& pb_creator,
211215

212216
// Now we fill the date_times
213217
for (auto dt_st : id_vec.second) {
214-
update_display_information(vj_found, dt_st, pt_display_information, pb_creator);
218+
if (!vj_found) {
219+
vj_found = update_display_information(vj_found, dt_st.second, pt_display_information, pb_creator);
220+
}
215221
fill_date_times(pb_creator, schedule, dt_st, calendar_id);
216222
}
217223

0 commit comments

Comments
 (0)