From 96ada7302028d6ece6bed1958b44f7f90f5be2f7 Mon Sep 17 00:00:00 2001 From: Yury Melnichek Date: Sat, 24 Sep 2011 15:17:08 +0200 Subject: [PATCH] Minor optimization in ForEachInIntervalAndScale(). --- indexer/scale_index.hpp | 6 ++++-- search/engine.cpp | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/indexer/scale_index.hpp b/indexer/scale_index.hpp index 826bb22f2d..ca9286e632 100644 --- a/indexer/scale_index.hpp +++ b/indexer/scale_index.hpp @@ -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(ref(f), _1), beg, end); + m_IndexForScale[i]->DoForEach(f1, beg, end); + } } private: diff --git a/search/engine.cpp b/search/engine.cpp index ebfce5ef22..155fb002dc 100644 --- a/search/engine.cpp +++ b/search/engine.cpp @@ -7,6 +7,7 @@ #include "../base/logging.hpp" +#include "../std/bind.hpp" #include "../std/function.hpp" #include "../std/string.hpp" #include "../std/vector.hpp"