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
path: root/search
diff options
context:
space:
mode:
authorMaxim Pimenov <m@maps.me>2015-07-31 15:52:02 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:58:26 +0300
commit1b99ee9824daa6c2049ebe08fc8f353a7c7707cf (patch)
tree5c8d8974a312ddbdc5498d786da4fea5bbcf1f79 /search
parent974687ff983a9830c3eeb35505969cb7a3956ba8 (diff)
Review fixes.
Diffstat (limited to 'search')
-rw-r--r--search/search_query.cpp38
-rw-r--r--search/search_query.hpp2
2 files changed, 15 insertions, 25 deletions
diff --git a/search/search_query.cpp b/search/search_query.cpp
index 537605443b..afd5e3f5a5 100644
--- a/search/search_query.cpp
+++ b/search/search_query.cpp
@@ -10,15 +10,15 @@
#include "storage/country_info.hpp"
-#include "indexer/feature_impl.hpp"
+#include "indexer/categories_holder.hpp"
+#include "indexer/classificator.hpp"
#include "indexer/feature_covering.hpp"
+#include "indexer/feature_impl.hpp"
#include "indexer/features_vector.hpp"
#include "indexer/index.hpp"
#include "indexer/scales.hpp"
#include "indexer/search_delimiters.hpp"
#include "indexer/search_string_utils.hpp"
-#include "indexer/categories_holder.hpp"
-#include "indexer/classificator.hpp"
#include "platform/preferred_languages.hpp"
@@ -26,8 +26,8 @@
#include "coding/reader_wrapper.hpp"
#include "base/logging.hpp"
-#include "base/string_utils.hpp"
#include "base/stl_add.hpp"
+#include "base/string_utils.hpp"
#include "std/algorithm.hpp"
#include "std/function.hpp"
@@ -75,16 +75,13 @@ Query::Query(Index const * pIndex, CategoriesHolder const * pCategories,
, m_pCategories(pCategories)
, m_pStringsToSuggest(pStringsToSuggest)
, m_pInfoGetter(pInfoGetter)
- ,
#ifdef HOUSE_SEARCH_TEST
- m_houseDetector(pIndex)
- ,
+ , m_houseDetector(pIndex)
#endif
#ifdef FIND_LOCALITY_TEST
- m_locality(pIndex)
- ,
+ , m_locality(pIndex)
#endif
- m_worldSearch(true)
+ , m_worldSearch(true)
{
// m_viewport is initialized as empty rects
@@ -331,8 +328,8 @@ void Query::Init(bool viewportSearch)
else
{
m_queuesCount = kQueuesCount;
- m_results[kDistanceToPivot] =
- TQueue(kPreResultsCount, TQueueCompare(g_arrCompare1[kDistanceToPivot]));
+ m_results[DISTANCE_TO_PIVOT] =
+ TQueue(kPreResultsCount, TQueueCompare(g_arrCompare1[DISTANCE_TO_PIVOT]));
}
}
@@ -483,15 +480,10 @@ class ProxyFunctor1
public:
template <class T>
- explicit ProxyFunctor1(T const & p)
- : m_fn(*p)
- {
- }
+ explicit ProxyFunctor1(T const & p) : m_fn(*p) {}
+
template <class T>
- bool operator()(T const & p)
- {
- return m_fn(*p);
- }
+ bool operator()(T const & p) { return m_fn(*p); }
};
template <class TFunctor>
@@ -1332,11 +1324,9 @@ namespace impl
size_t & m_count;
public:
DoCount(size_t & count) : m_count(count) { m_count = 0; }
+
template <class T>
- void operator()(T const &)
- {
- ++m_count;
- }
+ void operator()(T const &) { ++m_count; }
};
bool IsFullNameMatched() const
diff --git a/search/search_query.hpp b/search/search_query.hpp
index 896ad71aa2..dbf98a7a64 100644
--- a/search/search_query.hpp
+++ b/search/search_query.hpp
@@ -262,7 +262,7 @@ private:
// g_arrCompare1, g_arrCompare2 function arrays.
enum
{
- kDistanceToPivot, // LessDistance
+ DISTANCE_TO_PIVOT, // LessDistance
FEATURE_RANK // LessRank
};
TQueue m_results[kQueuesCount];