From a7ac3d555c82df5a479542ee6c49e9d596a82ce9 Mon Sep 17 00:00:00 2001 From: tatiana-kondakova Date: Mon, 21 Aug 2017 14:32:56 +0300 Subject: [PATCH] Fix routing progress --- routing/index_router.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/routing/index_router.cpp b/routing/index_router.cpp index a3f341e270..bfef6d1533 100644 --- a/routing/index_router.cpp +++ b/routing/index_router.cpp @@ -534,6 +534,7 @@ IRouter::ResultCode IndexRouter::CalculateSubroute(Checkpoints const & checkpoin progress.Initialize(starter.GetStartVertex().GetPoint(), starter.GetFinishVertex().GetPoint()); uint32_t visitCount = 0; + auto lastValue = progress.GetLastValue(); auto onVisitJunction = [&](Segment const & from, Segment const & to) { if (++visitCount % kVisitPeriod != 0) @@ -541,10 +542,12 @@ IRouter::ResultCode IndexRouter::CalculateSubroute(Checkpoints const & checkpoin m2::PointD const & pointFrom = starter.GetPoint(from, true /* front */); m2::PointD const & pointTo = starter.GetPoint(to, true /* front */); - auto const lastValue = progress.GetLastValue(); auto const newValue = progress.GetProgressForBidirectedAlgo(pointFrom, pointTo); if (newValue - lastValue > kProgressInterval) + { + lastValue = newValue; delegate.OnProgress(newValue); + } delegate.OnPointCheck(pointFrom); };