@@ -66,16 +66,18 @@ static bool is_terminus_for_all_stop_times(const std::vector<routing::datetime_s
66
66
return !stop_times.empty ();
67
67
}
68
68
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 ,
71
71
pbnavitia::PtDisplayInfo* pt_display_information,
72
72
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 ;
75
75
pt_display_information->set_trip_short_name (vj->name );
76
76
pt_display_information->set_headsign (pb_creator.data ->pt_data ->headsign_handler .get_headsign (vj));
77
- vj_found = true ;
77
+ return true ;
78
78
}
79
+
80
+ return false ;
79
81
}
80
82
81
83
static void fill_date_times (PbCreator& pb_creator,
@@ -148,7 +150,9 @@ static void render(PbCreator& pb_creator,
148
150
149
151
// Now we fill the date_times
150
152
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
+ }
152
156
fill_date_times (pb_creator, schedule, dt_st, calendar_id);
153
157
}
154
158
@@ -211,7 +215,9 @@ static void render(PbCreator& pb_creator,
211
215
212
216
// Now we fill the date_times
213
217
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
+ }
215
221
fill_date_times (pb_creator, schedule, dt_st, calendar_id);
216
222
}
217
223
0 commit comments