diff options
author | Yury Melnichek <melnichek@gmail.com> | 2011-02-13 01:31:30 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:12:15 +0300 |
commit | edfa09730e8ec3b5e930c7a1895ad4c6696d453c (patch) | |
tree | 62d910bf26183bc291dd09f110ee668cff608ae3 /map/feature_vec_model.hpp | |
parent | 479a21cb05667ba3380f818bd7614e152a495372 (diff) |
Cache Index::Query in FeaturesFetcher.
Diffstat (limited to 'map/feature_vec_model.hpp')
-rw-r--r-- | map/feature_vec_model.hpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/map/feature_vec_model.hpp b/map/feature_vec_model.hpp index f7a2a60409..bc395a157b 100644 --- a/map/feature_vec_model.hpp +++ b/map/feature_vec_model.hpp @@ -31,6 +31,9 @@ namespace model index_t m_multiIndex; + // Cached query, which stores several caches for the index. + mutable index_t::Query m_multiIndexQuery; + public: void InitClassificator(); @@ -43,7 +46,8 @@ namespace model template <class ToDo> void ForEachFeature(m2::RectD const & rect, ToDo toDo) const { - m_multiIndex.ForEachInViewport(toDo, rect); + m_multiIndexQuery.Clear(); + m_multiIndex.ForEachInViewport(toDo, rect, m_multiIndexQuery); // Uncomment to traverse all features (SLOW!!): // m_multiIndex.ForEachInScale(toDo, GetScaleLevel(rect)); } |