Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2015-01-29 12:15:44 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:36:38 +0300
commit136995a8e0ab70bf10f19a255dc49d67600f8048 (patch)
treec51e2895c5cbebbf0cc4d4755b702c7c74ffbeff /indexer/search_index_builder.cpp
parent819857fdd268d9010b0e7e6ef855cf5c84bd3cb8 (diff)
Use range base for in feature::TypesHolder.
Diffstat (limited to 'indexer/search_index_builder.cpp')
-rw-r--r--indexer/search_index_builder.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/indexer/search_index_builder.cpp b/indexer/search_index_builder.cpp
index 6d07253127..12ca7b4e68 100644
--- a/indexer/search_index_builder.cpp
+++ b/indexer/search_index_builder.cpp
@@ -265,11 +265,9 @@ class FeatureInserter
bool IsCountryOrState(feature::TypesHolder const & types) const
{
- for (size_t i = 0; i < types.Size(); ++i)
+ for (uint32_t t : types)
{
- uint32_t t = types[i];
ftype::TruncValue(t, 2);
-
if (t == m_country || t == m_state)
return true;
}
@@ -311,25 +309,23 @@ public:
Classificator const & c = classif();
// add names of categories of the feature
- for (size_t i = 0; i < types.Size(); ++i)
+ for (uint32_t t : types)
{
- uint32_t type = types[i];
-
// Leave only 2 level of type - for example, do not distinguish:
// highway-primary-bridge or amenity-parking-fee.
- ftype::TruncValue(type, 2);
+ ftype::TruncValue(t, 2);
// Push to index only categorized types.
- if (m_categories.IsTypeExist(type))
+ if (m_categories.IsTypeExist(t))
{
// Do index only for visible types in mwm.
- pair<int, int> const r = feature::GetDrawableScaleRange(type);
- CHECK(r.first <= r.second && r.first != -1, (c.GetReadableObjectName(type)));
+ pair<int, int> const r = feature::GetDrawableScaleRange(t);
+ CHECK(r.first <= r.second && r.first != -1, (c.GetReadableObjectName(t)));
if (r.second >= m_scales.first && r.first <= m_scales.second)
{
inserter.AddToken(search::CATEGORIES_LANG,
- search::FeatureTypeToString(c.GetIndexForType(type)));
+ search::FeatureTypeToString(c.GetIndexForType(t)));
}
}
}