Remove some qBinaryFind usages from QtWidgets

This is done per the mailing list discussion at
http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: I7e4a5a4010b0ded59dbe2cacc6afe23ae4121bfe
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
This commit is contained in:
Giuseppe D'Angelo 2013-09-20 16:22:12 +02:00 committed by The Qt Project
parent bacbf1fcf3
commit 893a9e1cf8
2 changed files with 5 additions and 7 deletions

View File

@ -1689,12 +1689,10 @@ void QFileSystemModelPrivate::_q_directoryChanged(const QString &directory, cons
std::sort(newFiles.begin(), newFiles.end());
QHash<QString, QFileSystemNode*>::const_iterator i = parentNode->children.constBegin();
while (i != parentNode->children.constEnd()) {
QStringList::iterator iterator;
iterator = qBinaryFind(newFiles.begin(), newFiles.end(),
i.value()->fileName);
if (iterator == newFiles.end()) {
QStringList::iterator iterator = std::lower_bound(newFiles.begin(), newFiles.end(), i.value()->fileName);
if ((iterator == newFiles.end()) || (i.value()->fileName < *iterator))
toRemove.append(i.value()->fileName);
}
++i;
}
for (int i = 0 ; i < toRemove.count() ; ++i )

View File

@ -176,8 +176,8 @@ void QGraphicsItemAnimationPrivate::insertUniquePair(qreal step, qreal value, QL
Pair pair(step, value);
QList<Pair>::iterator result = qBinaryFind(binList->begin(), binList->end(), pair);
if (result != binList->end())
QList<Pair>::iterator result = std::lower_bound(binList->begin(), binList->end(), pair);
if ((result != binList->end()) && !(pair < *result))
result->value = value;
else {
*binList << pair;