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:
authorvng <viktor.govako@gmail.com>2016-02-18 17:36:05 +0300
committerSergey Yershov <yershov@corp.mail.ru>2016-03-23 16:21:25 +0300
commit0cff2e4e4c1416021924a9624f4fcb3a354a0007 (patch)
tree9e6283e34911541e2aa3c386403b1a75335290d4 /geometry
parentda0589d5f01736cf54d8a48b2fdb354ab4ce7958 (diff)
Do not store useless rect in localities cache.
Diffstat (limited to 'geometry')
-rw-r--r--geometry/tree4d.hpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/geometry/tree4d.hpp b/geometry/tree4d.hpp
index f0a61bb6d0..90dec33c09 100644
--- a/geometry/tree4d.hpp
+++ b/geometry/tree4d.hpp
@@ -220,14 +220,20 @@ namespace m4
}
template <class ToDo>
- void ForEach(ToDo toDo) const
+ void ForEach(ToDo && toDo) const
{
for (ValueT const & v : m_tree)
toDo(v.m_val);
}
+ template <class ToDo>
+ void ForEachEx(ToDo && toDo) const
+ {
+ for (ValueT const & v : m_tree)
+ toDo(v.GetRect(), v.m_val);
+ }
template <class ToDo>
- bool FindNode(ToDo const & toDo) const
+ bool FindNode(ToDo && toDo) const
{
for (ValueT const & v : m_tree)
if (toDo(v.m_val))
@@ -237,16 +243,14 @@ namespace m4
}
template <class ToDo>
- void ForEachWithRect(ToDo toDo) const
+ void ForEachInRect(m2::RectD const & rect, ToDo && toDo) const
{
- for (ValueT const & v : m_tree)
- toDo(v.GetRect(), v.m_val);
+ m_tree.for_each(GetFunctor(rect, [&toDo] (ValueT const & v) { toDo(v.m_val); }));
}
-
template <class ToDo>
- void ForEachInRect(m2::RectD const & rect, ToDo toDo) const
+ void ForEachInRectEx(m2::RectD const & rect, ToDo && toDo) const
{
- m_tree.for_each(GetFunctor(rect, [&toDo] (ValueT const & v) { toDo(v.m_val); }));
+ m_tree.for_each(GetFunctor(rect, [&toDo] (ValueT const & v) { toDo(v.GetRect(), v.m_val); }));
}
bool IsEmpty() const { return m_tree.empty(); }