recostruct path only if router had been succeeded

This commit is contained in:
Constantin Shalnev 2015-04-29 13:52:51 +03:00 committed by Alex Zolotarev
parent 166941f823
commit ecd0052b31

View file

@ -90,14 +90,18 @@ IRouter::ResultCode RoadGraphRouter::CalculateRoute(m2::PointD const & startPoin
m_roadGraph->AddFakeTurns(finalPos, finalVicinity);
vector<RoadPos> routePos;
IRouter::ResultCode resultCode = CalculateRoute(startPos, finalPos, routePos);
ASSERT(routePos.back() == finalPos, ());
ASSERT(routePos.front() == startPos, ());
IRouter::ResultCode const resultCode = CalculateRoute(startPos, finalPos, routePos);
LOG(LINFO, ("Route calculation time:", timer.ElapsedSeconds(), "result code:", resultCode));
m_roadGraph->ReconstructPath(routePos, route);
if (IRouter::NoError == resultCode)
{
ASSERT(routePos.back() == finalPos, ());
ASSERT(routePos.front() == startPos, ());
m_roadGraph->ReconstructPath(routePos, route);
}
return resultCode;
}