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>
bb10
Marc Mutz 2021-12-09 09:26:41 +01:00
parent 64cac8b7be
commit 574be167fb
1 changed files with 1 additions and 6 deletions

View File

@ -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