diff --git a/generator/osm2type.cpp b/generator/osm2type.cpp index 00b074c41e..7595106851 100644 --- a/generator/osm2type.cpp +++ b/generator/osm2type.cpp @@ -626,15 +626,20 @@ void PreprocessElement(OsmElement * p) CHECK(infoGetter, ()); auto static const countryTree = storage::LoadCountriesFromFile(COUNTRIES_FILE); CHECK(countryTree, ()); - std::set provinceToStateCountries = {"Japan", "South Korea", "Turkey"}; p->UpdateTag("place", [&](string & value) { if (value != "province") return; + std::array const provinceToStateCountries = {"Japan", "South Korea", + "Turkey"}; auto const pt = mercator::FromLatLon(p->m_lat, p->m_lon); auto const countryId = infoGetter->GetRegionCountryId(pt); - if (provinceToStateCountries.count(storage::GetTopmostParentFor(*countryTree, countryId)) > 0) + auto const country = storage::GetTopmostParentFor(*countryTree, countryId); + if (base::FindIf(provinceToStateCountries, [&](auto const & c) { return c == country; }) != + provinceToStateCountries.end()) + { value = "state"; + } }); } diff --git a/storage/country_tree_helpers.cpp b/storage/country_tree_helpers.cpp index c9e7b557c1..61c65b80e2 100644 --- a/storage/country_tree_helpers.cpp +++ b/storage/country_tree_helpers.cpp @@ -13,7 +13,7 @@ CountryId GetTopmostParentFor(CountryTree const & countries, CountryId const & c countries.Find(countryId, nodes); if (nodes.empty()) { - LOG(LWARNING, ("CountryId =", countryId, "not found in m_countries.")); + LOG(LWARNING, ("CountryId =", countryId, "not found in countries.")); return {}; }