summaryrefslogtreecommitdiffstats
path: root/src/corelib/codecs
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2013-09-20 16:22:12 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-23 21:20:47 +0200
commitddefc7627d70c46dadfa934dd3754a2aff0dbfea (patch)
tree79ab3a703bd894c34a293615cf45b095c181663f /src/corelib/codecs
parent7a6a902e2d7fc6da7e91ab49d75291f905b846ce (diff)
Remove qBinaryFind usages from QtCore
This is done per the mailing list discussion at http://www.mail-archive.com/development@qt-project.org/msg01603.html Change-Id: I6207982c08c92f3e01fb236d2e7546a1c9acd287 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/codecs')
-rw-r--r--src/corelib/codecs/qeuckrcodec.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/codecs/qeuckrcodec.cpp b/src/corelib/codecs/qeuckrcodec.cpp
index 20ba1e85d6..873b782378 100644
--- a/src/corelib/codecs/qeuckrcodec.cpp
+++ b/src/corelib/codecs/qeuckrcodec.cpp
@@ -70,6 +70,8 @@
#include "qeuckrcodec_p.h"
#include "cp949codetbl_p.h"
+#include <algorithm>
+
QT_BEGIN_NAMESPACE
#ifndef QT_NO_BIG_CODECS
@@ -3383,8 +3385,8 @@ QByteArray QCP949Codec::convertFromUnicode(const QChar *uc, int len, ConverterSt
*cursor++ = (j >> 8) | 0x80;
*cursor++ = (j & 0xff) | 0x80;
} else {
- const unsigned short *ptr = qBinaryFind(cp949_icode_to_unicode, cp949_icode_to_unicode + 8822, ch);
- if (ptr == cp949_icode_to_unicode + 8822) {
+ const unsigned short *ptr = std::lower_bound(cp949_icode_to_unicode, cp949_icode_to_unicode + 8822, ch);
+ if (ptr == cp949_icode_to_unicode + 8822 || ch < *ptr) {
// Error
*cursor++ = replacement;
++invalid;