From b15599f01e57751c306e5fd2a13d8bcb4db83f45 Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Fri, 27 Mar 2015 12:28:01 +0100 Subject: [PATCH] simplify logic to compute edge offset --- routing_algorithms/alternative_path.hpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/routing_algorithms/alternative_path.hpp b/routing_algorithms/alternative_path.hpp index 3b509573a..1dcc02096 100644 --- a/routing_algorithms/alternative_path.hpp +++ b/routing_algorithms/alternative_path.hpp @@ -102,10 +102,9 @@ class AlternativeRouting final int upper_bound_to_shortest_path_distance = INVALID_EDGE_WEIGHT; NodeID middle_node = SPECIAL_NODEID; - EdgeWeight min_edge_offset = - std::min(0, -phantom_node_pair.source_phantom.GetForwardWeightPlusOffset()); - min_edge_offset = std::min(min_edge_offset, - -phantom_node_pair.source_phantom.GetReverseWeightPlusOffset()); + const EdgeWeight min_edge_offset = + std::min(phantom_node_pair.source_phantom.GetForwardWeightPlusOffset(), + phantom_node_pair.source_phantom.GetReverseWeightPlusOffset()); if (phantom_node_pair.source_phantom.forward_node_id != SPECIAL_NODEID) {