diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2013-09-20 16:22:12 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-20 23:45:35 +0200 |
commit | 73637b7d1a01ca7db5fabe9a6fd5107bafd3c4c6 (patch) | |
tree | 8ed5edeac8d56ec0a8741f8824c9d8948a9757db /src/corelib/tools/qregexp.cpp | |
parent | 6a12da7fb3b78335ee4c39949381380b5a3325f9 (diff) |
Remove qBinaryFind usages from bootstrapped files
This is done per the mailing list discussion at
http://www.mail-archive.com/development@qt-project.org/msg01603.html
Change-Id: I492b49553bc889892f5ca0c47aa13c75e11518e2
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/tools/qregexp.cpp')
-rw-r--r-- | src/corelib/tools/qregexp.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp index 83e87ff637..086cdeb108 100644 --- a/src/corelib/tools/qregexp.cpp +++ b/src/corelib/tools/qregexp.cpp @@ -56,6 +56,7 @@ #include "private/qfunctions_p.h" #include <limits.h> +#include <algorithm> QT_BEGIN_NAMESPACE @@ -1537,7 +1538,7 @@ void QRegExpEngine::addPlusTransitions(const QVector<int> &from, const QVector<i for (int j = 0; j < to.size(); j++) { // ### st.reenter.contains(to.at(j)) check looks suspicious if (!st.reenter.contains(to.at(j)) && - qBinaryFind(oldOuts.constBegin(), oldOuts.constEnd(), to.at(j)) == oldOuts.end()) + !std::binary_search(oldOuts.constBegin(), oldOuts.constEnd(), to.at(j))) st.reenter.insert(to.at(j), atom); } } @@ -3245,8 +3246,9 @@ int QRegExpEngine::getEscape() } } else if (catlen > 2 && category.at(0) == 'I' && category.at(1) == 's') { static const int N = sizeof(categoriesRangeMap) / sizeof(categoriesRangeMap[0]); - const CategoriesRangeMapEntry *r = qBinaryFind(categoriesRangeMap, categoriesRangeMap + N, category.constData() + 2); - if (r != categoriesRangeMap + N) + const char * const categoryFamily = category.constData() + 2; + const CategoriesRangeMapEntry *r = std::lower_bound(categoriesRangeMap, categoriesRangeMap + N, categoryFamily); + if (r != categoriesRangeMap + N && qstrcmp(r->name, categoryFamily) == 0) yyCharClass->addRange(r->first, r->second); else error(RXERR_CATEGORY); |