From c6909b54509d797a61529ef88fe1d58baad88ac5 Mon Sep 17 00:00:00 2001 From: vng Date: Thu, 16 Feb 2012 18:40:13 +0300 Subject: [PATCH] Fix bug with std::find usage. --- indexer/feature_data.hpp | 3 ++- indexer/feature_visibility.cpp | 3 ++- search/intermediate_result.cpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/indexer/feature_data.hpp b/indexer/feature_data.hpp index 85b81f5565..8b5a2419a1 100644 --- a/indexer/feature_data.hpp +++ b/indexer/feature_data.hpp @@ -81,7 +81,8 @@ namespace feature inline bool Has(uint32_t t) const { - return find(m_types, m_types + m_size, t); + uint32_t const * e = m_types + m_size; + return (find(m_types, e, t) != e); } //@} diff --git a/indexer/feature_visibility.cpp b/indexer/feature_visibility.cpp index 2938c68e48..d75681444d 100644 --- a/indexer/feature_visibility.cpp +++ b/indexer/feature_visibility.cpp @@ -396,7 +396,8 @@ bool UsePopulationRank(uint32_t type) bool IsMyType(uint32_t t) const { - return find(m_types, m_types + ARRAY_SIZE(m_types), t); + uint32_t const * e = m_types + ARRAY_SIZE(m_types); + return (find(m_types, e, t) != e); } }; diff --git a/search/intermediate_result.cpp b/search/intermediate_result.cpp index fed49c3a77..02625aa9e2 100644 --- a/search/intermediate_result.cpp +++ b/search/intermediate_result.cpp @@ -256,7 +256,8 @@ namespace bool IsMy(uint8_t ind) const { - return find(m_index, m_index + ARRAY_SIZE(m_index), ind); + uint8_t const * e = m_index + ARRAY_SIZE(m_index); + return (find(m_index, e, ind) != e); } }; }