summaryrefslogtreecommitdiff
path: root/src/mongo/db/fts/unicode/string.cpp
diff options
context:
space:
mode:
authorApollon Oikonomopoulos <apoikos@debian.org>2018-03-22 12:08:05 +0200
committerApollon Oikonomopoulos <apoikos@debian.org>2018-03-22 12:08:05 +0200
commit72ad42c506a506ef238d4b1fdcf2b9da5668bfb9 (patch)
treedf94bdab3d6f16e14016f4547b9e86f368ba8150 /src/mongo/db/fts/unicode/string.cpp
parent648fcfa3cf11ba8fdb7bb64c52f3159b4351ae3c (diff)
parentc49e99631589113663b1a3ac691870421965a315 (diff)
Update upstream source from tag 'upstream/3.4.14'
Update to upstream version '3.4.14' with Debian dir 8c079cd0bdbb1831aa5b89a3b7d4c1b4a1b891a2
Diffstat (limited to 'src/mongo/db/fts/unicode/string.cpp')
-rw-r--r--src/mongo/db/fts/unicode/string.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mongo/db/fts/unicode/string.cpp b/src/mongo/db/fts/unicode/string.cpp
index 10737acc3ed..8c1890f3669 100644
--- a/src/mongo/db/fts/unicode/string.cpp
+++ b/src/mongo/db/fts/unicode/string.cpp
@@ -30,6 +30,7 @@
#include <algorithm>
#include <boost/algorithm/searching/boyer_moore.hpp>
+#include <boost/version.hpp>
#include "mongo/db/fts/unicode/byte_vector.h"
#include "mongo/platform/bits.h"
@@ -272,9 +273,15 @@ bool String::substrMatch(const std::string& str,
auto haystack = caseFoldAndStripDiacritics(&haystackBuf, str, options, cfMode);
auto needle = caseFoldAndStripDiacritics(&needleBuf, find, options, cfMode);
- // Case sensitive and diacritic sensitive.
+// Case sensitive and diacritic sensitive.
+#if BOOST_VERSION < 106200
return boost::algorithm::boyer_moore_search(
haystack.begin(), haystack.end(), needle.begin(), needle.end()) != haystack.end();
+#else
+ return boost::algorithm::boyer_moore_search(
+ haystack.begin(), haystack.end(), needle.begin(), needle.end()) !=
+ std::make_pair(haystack.end(), haystack.end());
+#endif
}
} // namespace unicode