| 875 | |
| 876 | template <typename Fn> |
| 877 | void Geocoder::ForEachCountry(ExtendedMwmInfos const & extendedInfos, Fn && fn) |
| 878 | { |
| 879 | for (size_t i = 0; i < extendedInfos.m_infos.size(); ++i) |
| 880 | { |
| 881 | auto const & info = extendedInfos.m_infos[i].m_info; |
| 882 | if (info->GetType() != MwmInfo::COUNTRY && info->GetType() != MwmInfo::WORLD) |
| 883 | continue; |
| 884 | if (info->GetType() == MwmInfo::COUNTRY && m_params.m_mode == Mode::Downloader) |
| 885 | continue; |
| 886 | |
| 887 | auto handle = m_dataSource.GetMwmHandleById(MwmSet::MwmId(info)); |
| 888 | if (!handle.IsAlive()) |
| 889 | continue; |
| 890 | auto & value = *handle.GetValue(); |
| 891 | if (!value.HasSearchIndex() || !value.HasGeometryIndex()) |
| 892 | continue; |
| 893 | bool const updatePreranker = i + 1 >= extendedInfos.m_firstBatchSize; |
| 894 | auto const & mwmType = extendedInfos.m_infos[i].m_type; |
| 895 | if (fn(make_unique<MwmContext>(std::move(handle), mwmType), updatePreranker) == base::ControlFlow::Break) |
| 896 | break; |
| 897 | } |
| 898 | } |
| 899 | |
| 900 | void Geocoder::MatchCategories(BaseContext & ctx, bool aroundPivot) |
| 901 | { |
no test coverage detected