[routing] SaveRoute minor fixes and CHECK.

Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
This commit is contained in:
Viktor Govako
2025-07-17 08:23:04 -03:00
committed by Konstantin Pastbin
parent c4599f4889
commit b107638b8b
4 changed files with 17 additions and 32 deletions

View File

@@ -1084,16 +1084,14 @@ kml::TrackId RoutingManager::SaveRoute()
std::vector<geometry::PointWithAltitude> junctions;
RoutingSession().GetRouteJunctionPoints(junctions);
junctions.erase(std::unique(junctions.begin(), junctions.end(),
[](geometry::PointWithAltitude const & p1, geometry::PointWithAltitude const & p2)
{ return AlmostEqualAbs(p1, p2, kMwmPointAccuracy); }),
junctions.end());
base::Unique(junctions, [](geometry::PointWithAltitude const & p1, geometry::PointWithAltitude const & p2)
{ return AlmostEqualAbs(p1, p2, kMwmPointAccuracy); });
auto const routePoints = GetRoutePoints();
std::string const from = GetNameFromPoint(routePoints.front());
std::string const to = GetNameFromPoint(routePoints.back());
return m_bmManager->SaveRoute(junctions, from, to);
return m_bmManager->SaveRoute(std::move(junctions), from, to);
}
bool RoutingManager::DisableFollowMode()