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:
authorYury Melnichek <melnichek@gmail.com>2011-02-13 01:12:01 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:12:13 +0300
commitcc940c7a09a3c472a02b13f4af6248cc8ff95eb1 (patch)
treef5f89184f1c9aae6e49042ee7a803da0031cdf06 /indexer/scale_index.hpp
parentdfb8ff6ff9048de29d426b9a65a665616cd9dda4 (diff)
Store IntervalIndex cache in Query. Should speed up index.
Diffstat (limited to 'indexer/scale_index.hpp')
-rw-r--r--indexer/scale_index.hpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/indexer/scale_index.hpp b/indexer/scale_index.hpp
index 7042f6cea8..f1be3abdb3 100644
--- a/indexer/scale_index.hpp
+++ b/indexer/scale_index.hpp
@@ -55,6 +55,8 @@ class ScaleIndex : public ScaleIndexBase
{
public:
typedef ReaderT ReaderType;
+ typedef IntervalIndex<uint32_t, ReaderT> IntervalIndexType;
+ typedef typename IntervalIndexType::Query Query;
ScaleIndex() {}
explicit ScaleIndex(ReaderT const & reader) { Attach(reader); }
@@ -70,15 +72,15 @@ public:
}
template <typename F>
- void ForEachInIntervalAndScale(F const & f, uint64_t beg, uint64_t end, uint32_t scale) const
+ void ForEachInIntervalAndScale(F const & f, uint64_t beg, uint64_t end, uint32_t scale,
+ Query & query) const
{
int scaleBucket = BucketByScale(scale);
ASSERT_LESS(scaleBucket, static_cast<int>(m_IndexForScale.size()), ());
for (int i = 0; i <= scaleBucket; ++i)
- m_IndexForScale[i].ForEach(f, beg, end);
+ m_IndexForScale[i].ForEach(f, beg, end, query);
}
private:
- typedef IntervalIndex<uint32_t, ReaderT> IntervalIndexType;
vector<IntervalIndexType> m_IndexForScale;
};