diff --git a/routing/absent_regions_finder.cpp b/routing/absent_regions_finder.cpp index 786a572956..90303ef212 100644 --- a/routing/absent_regions_finder.cpp +++ b/routing/absent_regions_finder.cpp @@ -37,8 +37,24 @@ void AbsentRegionsFinder::GenerateAbsentRegions(Checkpoints const & checkpoints, void AbsentRegionsFinder::GetAbsentRegions(std::set & absentCountries) { + std::set countries; + GetAllRegions(countries); + absentCountries.clear(); + for (auto const & mwmName : countries) + { + if (m_localFileCheckerFn(mwmName)) + continue; + + absentCountries.emplace(mwmName); + } +} + +void AbsentRegionsFinder::GetAllRegions(std::set & countries) +{ + countries.clear(); + if (!m_routerThread) return; @@ -46,10 +62,8 @@ void AbsentRegionsFinder::GetAbsentRegions(std::set & absentCountri for (auto const & mwmName : m_routerThread->GetRoutineAs()->GetMwmNames()) { - if (mwmName.empty() || m_localFileCheckerFn(mwmName)) - continue; - - absentCountries.emplace(mwmName); + if (!mwmName.empty()) + countries.emplace(mwmName); } m_routerThread.reset(); diff --git a/routing/absent_regions_finder.hpp b/routing/absent_regions_finder.hpp index 7aa45effff..d469d27a85 100644 --- a/routing/absent_regions_finder.hpp +++ b/routing/absent_regions_finder.hpp @@ -34,6 +34,8 @@ public: // Creates new thread |m_routerThread| and starts routing in it. void GenerateAbsentRegions(Checkpoints const & checkpoints, RouterDelegate const & delegate); // Waits for the routing thread |m_routerThread| to finish and returns results from it. + void GetAllRegions(std::set & countries); + // Waits for the results from GetAllRegions() and returns only regions absent on the device. void GetAbsentRegions(std::set & absentCountries); private: