aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2019-02-08 17:21:42 -0800
committerThiago Macieira <thiago.macieira@intel.com>2019-03-13 21:58:36 +0000
commit3323deeb9915fc51b6b1044798edc2160bf78087 (patch)
treef36b504d4f56b9298726202b7fbecc01c2c74aaa
parent4a2701a05400f0621cef04980c419637ff6d1d00 (diff)
Stop using deprecated qBinaryFind
cangjiedictionary.cpp:114:103: warning: ‘RandomAccessIterator qBinaryFind(RandomAccessIterator, RandomAccessIterator, const T&) [with RandomAccessIterator = const QChar*; T = QChar]’ is deprecated: Use std::binary_search [-Wdeprecated-declarations] But std::binary_search is stupid. Change-Id: Id061f35c088044b69a15fffd15819144eed7a621 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
-rw-r--r--src/plugins/tcime/3rdparty/tcime/cangjiedictionary.cpp4
-rw-r--r--src/plugins/tcime/3rdparty/tcime/phrasedictionary.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/tcime/3rdparty/tcime/cangjiedictionary.cpp b/src/plugins/tcime/3rdparty/tcime/cangjiedictionary.cpp
index 7326b839..b02c8fef 100644
--- a/src/plugins/tcime/3rdparty/tcime/cangjiedictionary.cpp
+++ b/src/plugins/tcime/3rdparty/tcime/cangjiedictionary.cpp
@@ -111,8 +111,8 @@ QStringList CangjieDictionary::searchWords(int secondaryIndex, const DictionaryE
DictionaryEntry::ConstIterator start = data.constBegin();
DictionaryEntry::ConstIterator end = start + length;
- DictionaryEntry::ConstIterator rangeStart = qBinaryFind(start, end, (DictionaryWord)secondaryIndex);
- if (rangeStart == end)
+ DictionaryEntry::ConstIterator rangeStart = std::lower_bound(start, end, (DictionaryWord)secondaryIndex);
+ if (rangeStart == end || *rangeStart != secondaryIndex)
return QStringList();
// There may be more than one words with the same index; look up words with
diff --git a/src/plugins/tcime/3rdparty/tcime/phrasedictionary.cpp b/src/plugins/tcime/3rdparty/tcime/phrasedictionary.cpp
index cdeaecdd..6bc62d84 100644
--- a/src/plugins/tcime/3rdparty/tcime/phrasedictionary.cpp
+++ b/src/plugins/tcime/3rdparty/tcime/phrasedictionary.cpp
@@ -47,8 +47,8 @@ QStringList PhraseDictionary::getWords(const QString &input) const
const DictionaryEntry &words = dict[0];
- DictionaryEntry::ConstIterator word = qBinaryFind(words, input.at(0));
- if (word == words.constEnd())
+ DictionaryEntry::ConstIterator word = std::lower_bound(words.begin(), words.end(), input.at(0));
+ if (word == words.constEnd() || *word != input.at(0))
return QStringList();
int index = word - words.constBegin();