diff --git a/routing/absent_regions_finder.cpp b/routing/absent_regions_finder.cpp index 90303ef212..9946e9b194 100644 --- a/routing/absent_regions_finder.cpp +++ b/routing/absent_regions_finder.cpp @@ -35,19 +35,17 @@ void AbsentRegionsFinder::GenerateAbsentRegions(Checkpoints const & checkpoints, m_routerThread->Create(move(router)); } -void AbsentRegionsFinder::GetAbsentRegions(std::set & absentCountries) +void AbsentRegionsFinder::GetAbsentRegions(std::set & regions) { - std::set countries; - GetAllRegions(countries); + regions.clear(); + GetAllRegions(regions); - absentCountries.clear(); - - for (auto const & mwmName : countries) + for (auto i = regions.begin(); i != regions.end();) { - if (m_localFileCheckerFn(mwmName)) - continue; - - absentCountries.emplace(mwmName); + if (m_localFileCheckerFn(*i)) + i = regions.erase(i); + else + ++i; } } diff --git a/routing/index_router.cpp b/routing/index_router.cpp index bf4f24983e..ae01365849 100644 --- a/routing/index_router.cpp +++ b/routing/index_router.cpp @@ -541,7 +541,7 @@ RouterResultCode IndexRouter::DoCalculateRoute(Checkpoints const & checkpoints, else if (guidesMwmId == kFakeNumMwmId) { guidesMwmId = m_numMwmIds->GetId(country); - }; + } } if (!route.GetAbsentCountries().empty()) diff --git a/routing/regions_router.cpp b/routing/regions_router.cpp index ff9dedca94..4886724960 100644 --- a/routing/regions_router.cpp +++ b/routing/regions_router.cpp @@ -88,10 +88,8 @@ void RegionsRouter::Do() for (size_t i = 0; i < m_checkpoints.GetNumSubroutes(); ++i) { - auto const & [pointFrom, mwmFrom] = GetCheckpointRegion(i); - auto const & [pointTo, mwmTo] = GetCheckpointRegion(i + 1); - - if (mwmFrom == mwmTo) + // equal mwm ids + if (GetCheckpointRegion(i).second == GetCheckpointRegion(i + 1).second) continue; std::optional const startFakeEnding = @@ -124,9 +122,9 @@ void RegionsRouter::Do() { for (bool front : {false, true}) { - LatLonWithAltitude const & point = subrouteStarter.GetJunction(s, front); - std::string name = m_countryFileGetterFn(mercator::FromLatLon(point.GetLatLon())); + auto const & ll = subrouteStarter.GetJunction(s, front).GetLatLon(); + std::string name = m_countryFileGetterFn(mercator::FromLatLon(ll)); if (name.empty() && !IndexGraphStarter::IsFakeSegment(s)) name = m_numMwmIds->GetFile(s.GetMwmId()).GetName();