@@ -66,6 +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,
71
+ pbnavitia::PtDisplayInfo* pt_display_information,
72
+ PbCreator& pb_creator) {
73
+ if (!vj_found && dt_st.second != nullptr ) {
74
+ auto vj = dt_st.second ->vehicle_journey ;
75
+ pt_display_information->set_trip_short_name (vj->name );
76
+ pt_display_information->set_headsign (pb_creator.data ->pt_data ->headsign_handler .get_headsign (vj));
77
+ vj_found = true ;
78
+ }
79
+ }
80
+
69
81
static void fill_date_times (PbCreator& pb_creator,
70
82
pbnavitia::StopSchedule* schedule,
71
83
const std::pair<unsigned int , const navitia::type::StopTime*>& dt_st,
@@ -136,12 +148,7 @@ static void render(PbCreator& pb_creator,
136
148
137
149
// Now we fill the date_times
138
150
for (auto dt_st : id_vec.second ) {
139
- if (!vj_found && dt_st.second != nullptr ) {
140
- auto vj = dt_st.second ->vehicle_journey ;
141
- pt_display_information->set_trip_short_name (vj->name );
142
- pt_display_information->set_headsign (pb_creator.data ->pt_data ->headsign_handler .get_headsign (vj));
143
- vj_found = true ;
144
- }
151
+ update_display_information (vj_found, dt_st, pt_display_information, pb_creator);
145
152
fill_date_times (pb_creator, schedule, dt_st, calendar_id);
146
153
}
147
154
@@ -204,12 +211,7 @@ static void render(PbCreator& pb_creator,
204
211
205
212
// Now we fill the date_times
206
213
for (auto dt_st : id_vec.second ) {
207
- if (!vj_found && dt_st.second != nullptr ) {
208
- auto vj = dt_st.second ->vehicle_journey ;
209
- pt_display_information->set_trip_short_name (vj->name );
210
- pt_display_information->set_headsign (pb_creator.data ->pt_data ->headsign_handler .get_headsign (vj));
211
- vj_found = true ;
212
- }
214
+ update_display_information (vj_found, dt_st, pt_display_information, pb_creator);
213
215
fill_date_times (pb_creator, schedule, dt_st, calendar_id);
214
216
}
215
217
0 commit comments