diff options
Diffstat (limited to 'routing')
-rw-r--r-- | routing/base/astar_progress.cpp | 4 | ||||
-rw-r--r-- | routing/index_router.cpp | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/routing/base/astar_progress.cpp b/routing/base/astar_progress.cpp index 51c91877d3..86b1a0bfeb 100644 --- a/routing/base/astar_progress.cpp +++ b/routing/base/astar_progress.cpp @@ -78,8 +78,8 @@ void AStarProgress::AppendSubProgress(AStarSubProgress const & subProgress) void AStarProgress::EraseLastSubProgress() { - ASSERT(m_subProgresses.begin() != m_subProgresses.end(), ()); - ASSERT(m_subProgresses.begin() != std::prev(m_subProgresses.end()), ()); + CHECK(m_subProgresses.begin() != m_subProgresses.end(), ()); + CHECK(m_subProgresses.begin() != std::prev(m_subProgresses.end()), ()); auto prevLast = std::prev(std::prev(m_subProgresses.end())); prevLast->Flush(m_subProgresses.back().GetMaxContribution()); diff --git a/routing/index_router.cpp b/routing/index_router.cpp index b0bbd5d5b4..8f9cde0710 100644 --- a/routing/index_router.cpp +++ b/routing/index_router.cpp @@ -428,9 +428,12 @@ RouterResultCode IndexRouter::DoCalculateRoute(Checkpoints const & checkpoints, AStarSubProgress subProgress(startCheckpoint, finishCheckpoint, contributionCoef); progress.AppendSubProgress(subProgress); + SCOPE_GUARD(eraseProgress, [&progress]() { + progress.EraseLastSubProgress(); + }); + auto const result = CalculateSubroute(checkpoints, i, delegate, progress, subrouteStarter, subroute); - progress.EraseLastSubProgress(); if (result != RouterResultCode::NoError) return result; @@ -614,10 +617,12 @@ RouterResultCode IndexRouter::CalculateSubroute(Checkpoints const & checkpoints, set<NumMwmId> const mwmIds = starter.GetMwms(); RouterResultCode const result = FindPath<Vertex, Edge, Weight>(params, mwmIds, routingResult, mode); + if (mode == WorldGraphMode::LeapsOnly) + progress.EraseLastSubProgress(); + if (result != RouterResultCode::NoError) return result; - progress.EraseLastSubProgress(); RouterResultCode const leapsResult = ProcessLeapsJoints(routingResult.m_path, delegate, starter.GetGraph().GetMode(), starter, progress, subroute); |