From 8afad5614a83909774b8562ea574b914d544478d Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Sun, 22 Sep 2013 22:29:03 +0200 Subject: [PATCH] const'ing new function --- RoutingAlgorithms/ShortestPathRouting.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/RoutingAlgorithms/ShortestPathRouting.h b/RoutingAlgorithms/ShortestPathRouting.h index f3c4686b5..80570b0fb 100644 --- a/RoutingAlgorithms/ShortestPathRouting.h +++ b/RoutingAlgorithms/ShortestPathRouting.h @@ -34,7 +34,7 @@ class ShortestPathRouting : public BasicRoutingInterface{ typedef SearchEngineData::QueryHeap QueryHeap; SearchEngineData & engine_working_data; - int ComputeEdgeOffset(const PhantomNode & phantom) { + int ComputeEdgeOffset(const PhantomNode & phantom) const { return phantom.weight1 + (phantom.isBidirected() ? phantom.weight2 : 0); } @@ -270,7 +270,10 @@ public: //Plug paths together, s.t. end of packed path is begin of temporary packed path if( !packed_path1.empty() && !packed_path2.empty() ) { - if( temporary_packed_path1.front() == temporary_packed_path2.front() ) { + if( + temporary_packed_path1.front() == + temporary_packed_path2.front() + ) { //both new route segments start with the same node //thus, one of the packedPath must go. BOOST_ASSERT_MSG( @@ -328,13 +331,12 @@ public: distance2 += local_upper_bound2; } - if( distance1 > distance2 ){ + if( distance1 > distance2 ) { std::swap( packed_path1, packed_path2 ); } remove_consecutive_duplicates_from_vector(packed_path1); super::UnpackPath(packed_path1, raw_route_data.computedShortestPath); raw_route_data.lengthOfShortestPath = std::min(distance1, distance2); - return; } };