From f4cc344e01e00e640bce10f03c47b25d19c3e7fc Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Sat, 14 Sep 2013 19:52:18 +0200 Subject: Revert "Reimplement qBinaryFind in terms of std::lower_bound" After a bit of discussion, we should actually deprecate qBinaryFind too. This puts the old code back (to avoid behavior changes / source breaks). This reverts commit 23d7f6ee5dea3dd9f47f4ab538b25dc0ffe3df92. Task-number: QTBUG-33473 Change-Id: I7f7d25171e14061e51543c501c30a7b6b184a8fd Reviewed-by: Olivier Goffart Reviewed-by: Marc Mutz --- src/corelib/tools/qalgorithms.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/corelib/tools/qalgorithms.h b/src/corelib/tools/qalgorithms.h index 3bd3812e78..8337afcb9d 100644 --- a/src/corelib/tools/qalgorithms.h +++ b/src/corelib/tools/qalgorithms.h @@ -43,7 +43,6 @@ #define QALGORITHMS_H #include -#include QT_BEGIN_NAMESPACE @@ -293,7 +292,7 @@ template Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFind(RandomAccessIterator begin, RandomAccessIterator end, const T &value) { // Implementation is duplicated from QAlgorithmsPrivate. - RandomAccessIterator it = std::lower_bound(begin, end, value); + RandomAccessIterator it = qLowerBound(begin, end, value); if (it == end || value < *it) return end; @@ -507,7 +506,7 @@ Q_OUTOFLINE_TEMPLATE RandomAccessIterator qUpperBoundHelper(RandomAccessIterator template Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFindHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan) { - RandomAccessIterator it = std::lower_bound(begin, end, value, lessThan); + RandomAccessIterator it = qLowerBoundHelper(begin, end, value, lessThan); if (it == end || lessThan(value, *it)) return end; -- cgit v1.2.3