diff options
author | Yury Melnichek <melnichek@gmail.com> | 2011-02-13 01:30:54 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:12:14 +0300 |
commit | 479a21cb05667ba3380f818bd7614e152a495372 (patch) | |
tree | 8552bd314215f9a041334337e4be5cac1422e60a /indexer/index.hpp | |
parent | 2d794703fdd58db576ae43a25cc2660494eacaf2 (diff) |
Add Clear() method to Query, which allows to use a single query multiple times. This saves processor time on initialization / de-initialization of caches.
Diffstat (limited to 'indexer/index.hpp')
-rw-r--r-- | indexer/index.hpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/indexer/index.hpp b/indexer/index.hpp index c8cd4a1ead..a679c469a9 100644 --- a/indexer/index.hpp +++ b/indexer/index.hpp @@ -259,6 +259,16 @@ public: // Defines base Query type. class Query : public BaseT::Query { + public: + // Clear query, so that it can be reused. + // This function doesn't release caches! + void Clear() + { + m_Offsets.clear(); + BaseT::Query::Clear(); + } + + private: // TODO: Remember max offsets.size() and initialize offsets with it? unordered_set<uint32_t> m_Offsets; friend class UniqueOffsetAdapter; |