diff --git a/map/bookmark_manager.cpp b/map/bookmark_manager.cpp index f3d7ce47f0..08c141f816 100644 --- a/map/bookmark_manager.cpp +++ b/map/bookmark_manager.cpp @@ -1041,6 +1041,7 @@ void BookmarkManager::UpdateElevationMyPosition(kml::TrackId const & trackId) { CHECK_THREAD_CHECKER(m_threadChecker, ()); + static_assert(TrackSelectionMark::kInvalidDistance < 0, ""); double myPositionDistance = TrackSelectionMark::kInvalidDistance; if (m_myPositionMark->HasPosition()) { diff --git a/map/track.cpp b/map/track.cpp index 26918b1a7e..c255fa4bb6 100644 --- a/map/track.cpp +++ b/map/track.cpp @@ -117,13 +117,14 @@ bool Track::GetPoint(double distanceInMeters, m2::PointD & pt) const { CHECK_GREATER_OR_EQUAL(distanceInMeters, 0.0, (distanceInMeters)); - if (fabs(distanceInMeters - m_cachedLengths.front()) < 1e-2) + double const kEpsMeters = 1e-2; + if (base::AlmostEqualAbs(distanceInMeters, m_cachedLengths.front(), kEpsMeters)) { pt = m_data.m_pointsWithAltitudes.front().GetPoint(); return true; } - if (fabs(distanceInMeters - m_cachedLengths.back()) < 1e-2) + if (base::AlmostEqualAbs(distanceInMeters, m_cachedLengths.back(), kEpsMeters)) { pt = m_data.m_pointsWithAltitudes.back().GetPoint(); return true;