From d73a113df53e84e26a4f173de7759bf6bed137bc Mon Sep 17 00:00:00 2001 From: Olga Khlopkova Date: Thu, 23 Jul 2020 14:07:31 +0300 Subject: [PATCH] [routing] Fix for crash in debug mode in A* UpdateProgress. --- routing/base/astar_progress.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/routing/base/astar_progress.cpp b/routing/base/astar_progress.cpp index 1ffb9f6f7f..5ad7fe70b3 100644 --- a/routing/base/astar_progress.cpp +++ b/routing/base/astar_progress.cpp @@ -101,7 +101,10 @@ double AStarProgress::UpdateProgress(ms::LatLon const & current, ms::LatLon cons double const newProgress = UpdateProgressImpl(m_subProgresses.begin(), current, end) * 100.0; m_lastPercentValue = std::max(m_lastPercentValue, newProgress); - ASSERT_LESS_OR_EQUAL(m_lastPercentValue, kMaxPercent, ()); + ASSERT(m_lastPercentValue < kMaxPercent || + base::AlmostEqualAbs(m_lastPercentValue, kMaxPercent, 1e-5 /* eps */), + (m_lastPercentValue, kMaxPercent)); + m_lastPercentValue = std::min(m_lastPercentValue, kMaxPercent); return m_lastPercentValue; }