Skip to content

Commit

Permalink
Merge pull request #5758 from woltapp/gcc10
Browse files Browse the repository at this point in the history
Fixes signed/unsigned comparision spotted by gcc10.
  • Loading branch information
gardster authored Aug 20, 2020
2 parents 8b40c59 + 919fe74 commit 699ca2b
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions include/engine/routing_algorithms/routing_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,17 +192,22 @@ void annotatePath(const FacadeT &facade,

const bool is_first_segment = unpacked_path.empty();

const std::size_t start_index =
(is_first_segment ? ((start_traversed_in_reverse)
? weight_vector.size() -
phantom_node_pair.source_phantom.fwd_segment_position - 1
: phantom_node_pair.source_phantom.fwd_segment_position)
: 0);
std::size_t start_index = 0;
if (is_first_segment)
{
unsigned short segment_position = phantom_node_pair.source_phantom.fwd_segment_position;
if (start_traversed_in_reverse)
{
segment_position = weight_vector.size() -
phantom_node_pair.source_phantom.fwd_segment_position - 1;
}
BOOST_ASSERT(segment_position >= 0);
start_index = static_cast<std::size_t>(segment_position);
}
const std::size_t end_index = weight_vector.size();

bool is_left_hand_driving = facade.IsLeftHandDriving(node_id);

BOOST_ASSERT(start_index >= 0);
BOOST_ASSERT(start_index < end_index);
for (std::size_t segment_idx = start_index; segment_idx < end_index; ++segment_idx)
{
Expand Down

0 comments on commit 699ca2b

Please sign in to comment.