diff --git a/routing/routing_helpers.cpp b/routing/routing_helpers.cpp index 26f7448fb0..baf6f02ce0 100644 --- a/routing/routing_helpers.cpp +++ b/routing/routing_helpers.cpp @@ -3,6 +3,10 @@ #include "traffic/traffic_info.hpp" +#include "base/stl_helpers.hpp" + +#include + namespace routing { using namespace traffic; @@ -43,6 +47,9 @@ void ReconstructRoute(IDirectionsEngine & engine, RoadGraphBase const & graph, return; } + CHECK(std::is_sorted(times.cbegin(), times.cend(), my::LessBy(&Route::TTimeItem::first)), ()); + CHECK(std::is_sorted(turnsDir.cbegin(), turnsDir.cend(), my::LessBy(&turns::TurnItem::m_index)), ()); + // @TODO(bykoianko) If the start and the finish of a route lies on the same road segment // engine->Generate() fills with empty vectors |times|, |turnsDir|, |junctions| and |segments|. // It's not correct and should be fixed. It's necessary to work corrrectly with such routes.