summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2021-12-09 09:26:41 +0100
committerMarc Mutz <marc.mutz@qt.io>2021-12-09 18:25:49 +0100
commit574be167fbe578ce2967bb3588cdfd4d65a88a45 (patch)
tree6dfb020d00d841c8e9a7a412aa341eb046ebe42c
parent64cac8b7bebbb9a1a95ba99722ae3245ff3252bd (diff)
QVarLengthArray: use C++14 4-arg std::equal()
Simplifies the code, since we now need neither the manual size check, nor the warning fix (checked iterator macro) for MSVC. Change-Id: Ic267c66eb4568d2db8d9c9ccad0ce7e1a5cc3373 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
-rw-r--r--src/corelib/tools/qvarlengtharray.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h
index c412f96110..72f9e4104c 100644
--- a/src/corelib/tools/qvarlengtharray.h
+++ b/src/corelib/tools/qvarlengtharray.h
@@ -336,12 +336,7 @@ public:
template <typename U = T, qsizetype Prealloc2 = Prealloc> friend
QTypeTraits::compare_eq_result<U> operator==(const QVarLengthArray<T, Prealloc> &l, const QVarLengthArray<T, Prealloc2> &r)
{
- if (l.size() != r.size())
- return false;
- const T *rb = r.begin();
- const T *b = l.begin();
- const T *e = l.end();
- return std::equal(b, e, QT_MAKE_CHECKED_ARRAY_ITERATOR(rb, r.size()));
+ return std::equal(l.begin(), l.end(), r.begin(), r.end());
}
template <typename U = T, qsizetype Prealloc2 = Prealloc> friend