diff --git a/routing/road_graph_router.cpp b/routing/road_graph_router.cpp index 36a1433884..827bde96ec 100644 --- a/routing/road_graph_router.cpp +++ b/routing/road_graph_router.cpp @@ -227,7 +227,9 @@ IRouter::ResultCode RoadGraphRouter::CalculateRoute(m2::PointD const & startPoin ASSERT_EQUAL(result.path.front(), startPos, ()); ASSERT_EQUAL(result.path.back(), finalPos, ()); ASSERT_GREATER(result.distance, 0., ()); - ReconstructRoute(m_directionsEngine.get(), *m_roadGraph, nullptr /* trafficColoring */, + + CHECK(m_directionsEngine, ()); + ReconstructRoute(*m_directionsEngine, *m_roadGraph, nullptr /* trafficColoring */, delegate, result.path, route); } diff --git a/routing/routing_helpers.cpp b/routing/routing_helpers.cpp index 11558c3a73..e50e51f2b3 100644 --- a/routing/routing_helpers.cpp +++ b/routing/routing_helpers.cpp @@ -7,7 +7,7 @@ namespace routing { using namespace traffic; -void ReconstructRoute(IDirectionsEngine * engine, IRoadGraph const & graph, +void ReconstructRoute(IDirectionsEngine & engine, IRoadGraph const & graph, shared_ptr const & trafficColoring, my::Cancellable const & cancellable, vector & path, Route & route) { @@ -29,8 +29,7 @@ void ReconstructRoute(IDirectionsEngine * engine, IRoadGraph const & graph, // @TODO(bykoianko) streetNames is not filled in Generate(). It should be done. Route::TStreets streetNames; vector trafficSegs; - if (engine) - engine->Generate(graph, path, times, turnsDir, junctions, trafficSegs, cancellable); + engine.Generate(graph, path, times, turnsDir, junctions, trafficSegs, cancellable); if (cancellable.IsCancelled()) return; diff --git a/routing/routing_helpers.hpp b/routing/routing_helpers.hpp index 32556fec19..8cde1c86a3 100644 --- a/routing/routing_helpers.hpp +++ b/routing/routing_helpers.hpp @@ -25,7 +25,7 @@ bool IsRoad(TTypes const & types) BicycleModel::AllLimitsInstance().HasRoadType(types); } -void ReconstructRoute(IDirectionsEngine * engine, IRoadGraph const & graph, +void ReconstructRoute(IDirectionsEngine & engine, IRoadGraph const & graph, shared_ptr const & trafficColoring, my::Cancellable const & cancellable, vector & path, Route & route); } // namespace rouing diff --git a/routing/single_mwm_router.cpp b/routing/single_mwm_router.cpp index 64d362328f..1c8e9c0a88 100644 --- a/routing/single_mwm_router.cpp +++ b/routing/single_mwm_router.cpp @@ -229,8 +229,10 @@ bool SingleMwmRouter::BuildRoute(MwmSet::MwmId const & mwmId, vector shared_ptr trafficColoring = m_trafficCache.GetTrafficInfo(mwmId); vector const oldJunctions(junctions); - ReconstructRoute(m_directionsEngine.get(), m_roadGraph, trafficColoring, delegate, junctions, - route); + + CHECK(m_directionsEngine, ()); + ReconstructRoute(*m_directionsEngine, m_roadGraph, trafficColoring, delegate, + junctions, route); if (junctions != oldJunctions) {