Minor optimization in ForEachInIntervalAndScale().

This commit is contained in:
Yury Melnichek 2011-09-24 15:17:08 +02:00 committed by Alex Zolotarev
parent 6368e0e6dc
commit 96ada73020
2 changed files with 5 additions and 2 deletions

View file

@ -11,7 +11,6 @@
#include "../base/stl_add.hpp"
#include "../std/algorithm.hpp"
#include "../std/bind.hpp"
class ScaleIndexBase
@ -94,8 +93,11 @@ public:
{
size_t const scaleBucket = BucketByScale(scale);
if (scaleBucket < m_IndexForScale.size())
{
IntervalIndexIFace::FunctionT f1(f);
for (size_t i = 0; i <= scaleBucket; ++i)
m_IndexForScale[i]->DoForEach(bind<void>(ref(f), _1), beg, end);
m_IndexForScale[i]->DoForEach(f1, beg, end);
}
}
private:

View file

@ -7,6 +7,7 @@
#include "../base/logging.hpp"
#include "../std/bind.hpp"
#include "../std/function.hpp"
#include "../std/string.hpp"
#include "../std/vector.hpp"