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:
authorMaxim Pimenov <m@maps.me>2016-05-31 15:46:29 +0300
committerMaxim Pimenov <m@maps.me>2016-05-31 15:48:17 +0300
commit25360bb42cc22cf09f6e0dbe66dc386de62d49c6 (patch)
tree859bd221a10dc8b1a08021eb2a06242a3b5681fe /search/common.hpp
parent17a4d3694e98405e50d65970ff5e4deb0a4eb77a (diff)
[search] Removed the "search_" prefix where it was redundant.
Diffstat (limited to 'search/common.hpp')
-rw-r--r--search/common.hpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/search/common.hpp b/search/common.hpp
new file mode 100644
index 0000000000..2bdc9300a6
--- /dev/null
+++ b/search/common.hpp
@@ -0,0 +1,20 @@
+#pragma once
+
+namespace search
+{
+/// Upper bound for max count of tokens for indexing and scoring.
+int constexpr MAX_TOKENS = 32;
+int constexpr MAX_SUGGESTS_COUNT = 5;
+
+template <typename IterT1, typename IterT2>
+bool StartsWith(IterT1 beg, IterT1 end, IterT2 begPrefix, IterT2 endPrefix)
+{
+ while (beg != end && begPrefix != endPrefix && *beg == *begPrefix)
+ {
+ ++beg;
+ ++begPrefix;
+ }
+ return begPrefix == endPrefix;
+}
+
+} // namespace search