File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
include/engine/routing_algorithms Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -192,17 +192,22 @@ void annotatePath(const FacadeT &facade,
192192
193193 const bool is_first_segment = unpacked_path.empty ();
194194
195- const std::size_t start_index =
196- (is_first_segment ? ((start_traversed_in_reverse)
197- ? weight_vector.size () -
198- phantom_node_pair.source_phantom .fwd_segment_position - 1
199- : phantom_node_pair.source_phantom .fwd_segment_position )
200- : 0 );
195+ std::size_t start_index = 0 ;
196+ if (is_first_segment)
197+ {
198+ unsigned short segment_position = phantom_node_pair.source_phantom .fwd_segment_position ;
199+ if (start_traversed_in_reverse)
200+ {
201+ segment_position = weight_vector.size () -
202+ phantom_node_pair.source_phantom .fwd_segment_position - 1 ;
203+ }
204+ BOOST_ASSERT (segment_position >= 0 );
205+ start_index = static_cast <std::size_t >(segment_position);
206+ }
201207 const std::size_t end_index = weight_vector.size ();
202208
203209 bool is_left_hand_driving = facade.IsLeftHandDriving (node_id);
204210
205- BOOST_ASSERT (start_index >= 0 );
206211 BOOST_ASSERT (start_index < end_index);
207212 for (std::size_t segment_idx = start_index; segment_idx < end_index; ++segment_idx)
208213 {
You can’t perform that action at this time.
0 commit comments