diff --git a/indexer/feature_data.hpp b/indexer/feature_data.hpp index fe208e6238..85b81f5565 100644 --- a/indexer/feature_data.hpp +++ b/indexer/feature_data.hpp @@ -81,11 +81,7 @@ namespace feature inline bool Has(uint32_t t) const { - for (size_t i = 0; i < m_size; ++i) - if (t == m_types[i]) - return true; - - return false; + return find(m_types, m_types + m_size, t); } //@} diff --git a/indexer/feature_visibility.cpp b/indexer/feature_visibility.cpp index e3e80370b1..2938c68e48 100644 --- a/indexer/feature_visibility.cpp +++ b/indexer/feature_visibility.cpp @@ -396,10 +396,7 @@ bool UsePopulationRank(uint32_t type) bool IsMyType(uint32_t t) const { - for (size_t i = 0; i < ARRAY_SIZE(m_types); ++i) - if (t == m_types[i]) - return true; - return false; + return find(m_types, m_types + ARRAY_SIZE(m_types), t); } }; diff --git a/search/intermediate_result.cpp b/search/intermediate_result.cpp index 5986758cd3..fed49c3a77 100644 --- a/search/intermediate_result.cpp +++ b/search/intermediate_result.cpp @@ -241,27 +241,22 @@ namespace class IsLinearChecker { - static size_t const m_count = 2; - uint8_t m_index[m_count]; + uint8_t m_index[2]; public: IsLinearChecker() { char const * arr[] = { "highway", "waterway" }; - STATIC_ASSERT ( ARRAY_SIZE(arr) == m_count ); + STATIC_ASSERT ( ARRAY_SIZE(arr) == ARRAY_SIZE(m_index) ); ClassifObject const * c = classif().GetRoot(); - for (size_t i = 0; i < m_count; ++i) + for (size_t i = 0; i < ARRAY_SIZE(m_index); ++i) m_index[i] = static_cast(c->BinaryFind(arr[i]).GetIndex()); } bool IsMy(uint8_t ind) const { - for (size_t i = 0; i < m_count; ++i) - if (ind == m_index[i]) - return true; - - return false; + return find(m_index, m_index + ARRAY_SIZE(m_index), ind); } }; }