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>
This commit is contained in:
parent
7a6a902e2d
commit
ddefc7627d
@ -310,8 +310,8 @@ void QVariantAnimationPrivate::setCurrentValueForProgress(const qreal progress)
|
||||
QVariant QVariantAnimationPrivate::valueAt(qreal step) const
|
||||
{
|
||||
QVariantAnimation::KeyValues::const_iterator result =
|
||||
qBinaryFind(keyValues.begin(), keyValues.end(), qMakePair(step, QVariant()), animationValueLessThan);
|
||||
if (result != keyValues.constEnd())
|
||||
std::lower_bound(keyValues.constBegin(), keyValues.constEnd(), qMakePair(step, QVariant()), animationValueLessThan);
|
||||
if (result != keyValues.constEnd() && !animationValueLessThan(qMakePair(step, QVariant()), *result))
|
||||
return result->second;
|
||||
|
||||
return QVariant();
|
||||
|
@ -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;
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include "qurl_p.h"
|
||||
|
||||
#include <QtCore/qstringlist.h>
|
||||
#include <algorithm>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -1461,10 +1462,10 @@ static void mapToLowerCase(QString *str, int from)
|
||||
++i;
|
||||
}
|
||||
}
|
||||
const NameprepCaseFoldingEntry *entry = qBinaryFind(NameprepCaseFolding,
|
||||
const NameprepCaseFoldingEntry *entry = std::lower_bound(NameprepCaseFolding,
|
||||
NameprepCaseFolding + N,
|
||||
uc);
|
||||
if ((entry - NameprepCaseFolding) != N) {
|
||||
if ((entry != NameprepCaseFolding + N) && !(uc < *entry)) {
|
||||
int l = 1;
|
||||
while (l < 4 && entry->mapping[l])
|
||||
++l;
|
||||
|
Loading…
Reference in New Issue
Block a user