forked from organicmaps/organicmaps
Cache Index::Query in FeaturesFetcher.
This commit is contained in:
parent
479a21cb05
commit
edfa09730e
1 changed files with 5 additions and 1 deletions
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue