From 5dfb92b4e511389452ccc146c74083e1c2d2dfeb Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Wed, 26 Jul 2017 14:11:17 +0300 Subject: [PATCH] Review fixes. --- routing/index_router.cpp | 6 +++--- routing/index_router.hpp | 7 ++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/routing/index_router.cpp b/routing/index_router.cpp index 9fb2039be4..7c983bab81 100644 --- a/routing/index_router.cpp +++ b/routing/index_router.cpp @@ -253,7 +253,7 @@ IRouter::ResultCode IndexRouter::DoCalculateRoute(Checkpoints const & checkpoint segments.push_back(IndexGraphStarter::kStartFakeSegment); Segment startSegment; - if (!FindBestSegment(checkpoints.GetPointFrom(), startDirection, true, graph, startSegment)) + if (!FindBestSegment(checkpoints.GetPointFrom(), startDirection, true /* isOutgoing */, graph, startSegment)) return IRouter::StartPointNotFound; size_t subrouteSegmentsBegin = 0; @@ -332,7 +332,7 @@ IRouter::ResultCode IndexRouter::CalculateSubroute(Checkpoints const & checkpoin auto const & finishCheckpoint = checkpoints.GetPoint(subrouteIdx + 1); Segment finishSegment; - if (!FindBestSegment(finishCheckpoint, {0.0, 0.0}, false, graph, finishSegment)) + if (!FindBestSegment(finishCheckpoint, m2::PointD::Zero(), false /* isOutgoing */, graph, finishSegment)) { bool const isLastSubroute = subrouteIdx == checkpoints.GetNumSubroutes() - 1; return isLastSubroute ? IRouter::EndPointNotFound : IRouter::IntermediatePointNotFound; @@ -399,7 +399,7 @@ IRouter::ResultCode IndexRouter::AdjustRoute(Checkpoints const & checkpoints, Segment startSegment; m2::PointD const & pointFrom = checkpoints.GetPointFrom(); - if (!FindBestSegment(pointFrom, startDirection, true, graph, startSegment)) + if (!FindBestSegment(pointFrom, startDirection, true /* isOutgoing */, graph, startSegment)) return IRouter::StartPointNotFound; auto const & lastSubroutes = m_lastRoute->GetSubroutes(); diff --git a/routing/index_router.hpp b/routing/index_router.hpp index 4e7a0f5b1e..c392eea790 100644 --- a/routing/index_router.hpp +++ b/routing/index_router.hpp @@ -70,11 +70,8 @@ private: /// to |startDirection|. /// \param isOutgoing == true is |point| is considered as the start of the route. /// isOutgoing == false is |point| is considered as the finish of the route. - bool FindBestSegment(m2::PointD const & point, - m2::PointD const & startDirection, - bool isOutgoing, - WorldGraph & worldGraph, - Segment & bestSegment) const; + bool FindBestSegment(m2::PointD const & point, m2::PointD const & startDirection, bool isOutgoing, + WorldGraph & worldGraph, Segment & bestSegment) const; // Input route may contains 'leaps': shortcut edges from mwm border enter to exit. // ProcessLeaps replaces each leap with calculated route through mwm. IRouter::ResultCode ProcessLeaps(vector const & input,