diff options
author | Yury Melnichek <melnichek@malinovka.local> | 2011-08-26 01:10:15 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:22:32 +0300 |
commit | 31f2a764cd99e2e184233b017218bb4064d28751 (patch) | |
tree | 2a54feb81c09cae28f16e79b75c6fc2731e7521a /indexer/old | |
parent | 940c975a933069485234682335bfcb18ecad8508 (diff) |
Fix bug when some feature were omitted from ForEachInRect. Remove Query class, since it's not used anywhere.
Diffstat (limited to 'indexer/old')
-rw-r--r-- | indexer/old/interval_index_101.hpp | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/indexer/old/interval_index_101.hpp b/indexer/old/interval_index_101.hpp index 2a72c841fe..fd2d4bfd65 100644 --- a/indexer/old/interval_index_101.hpp +++ b/indexer/old/interval_index_101.hpp @@ -49,16 +49,6 @@ class IntervalIndex : public IntervalIndexBase public: - class Query : public base_t::QueryIFace - { - public: - void Clear() {} - - private: - friend class IntervalIndex; - vector<char> m_IntervalIndexCache; - }; - IntervalIndex(ReaderT const & reader, int cellIdBytes = 5) : m_Reader(reader), m_CellIdBytes(cellIdBytes) { @@ -67,31 +57,23 @@ public: } template <typename F> - void ForEach(F const & f, uint64_t beg, uint64_t end, Query & query) const + void ForEach(F const & f, uint64_t beg, uint64_t end) const { ASSERT_LESS(beg, 1ULL << 8 * m_CellIdBytes, (beg, end)); ASSERT_LESS_OR_EQUAL(end, 1ULL << 8 * m_CellIdBytes, (beg, end)); // end is inclusive in ForEachImpl(). --end; - ForEachImpl(f, beg, end, m_Level0Index, m_CellIdBytes - 1, query); - } - - template <typename F> - void ForEach(F const & f, uint64_t beg, uint64_t end) const - { - Query query; - ForEach(f, beg, end, query); + ForEachImpl(f, beg, end, m_Level0Index, m_CellIdBytes - 1); } - virtual void DoForEach(FunctionT const & f, uint64_t beg, uint64_t end, QueryIFace & /*query*/) + virtual void DoForEach(FunctionT const & f, uint64_t beg, uint64_t end) { ForEach(f, beg, end); } private: template <typename F> - void ForEachImpl(F const & f, uint64_t beg, uint64_t end, Index const & index, int level, - Query & query) const + void ForEachImpl(F const & f, uint64_t beg, uint64_t end, Index const & index, int level) const { uint32_t const beg0 = static_cast<uint32_t>(beg >> (8 * level)); uint32_t const end0 = static_cast<uint32_t>(end >> (8 * level)); @@ -110,7 +92,7 @@ private: { Index index1; ReadIndex(index.GetBaseOffset() + (cumCount * sizeof(Index)), index1); - ForEachImpl(f, b1, e1, index1, level - 1, query); + ForEachImpl(f, b1, e1, index1, level - 1); } else { @@ -119,8 +101,8 @@ private: uint32_t const count = index.m_Count[i]; uint32_t pos = index.GetBaseOffset() + (cumCount * step); size_t const readSize = step * count; - query.m_IntervalIndexCache.assign(readSize, 0); - char * pData = &query.m_IntervalIndexCache[0]; + vector<char> dataCache(readSize, 0); + char * pData = &dataCache[0]; m_Reader.Read(pos, pData, readSize); for (uint32_t j = 0; j < count; ++j, pData += step) // for (uint32_t j = 0; j < count; ++j, pos += step) |