From 574be167fbe578ce2967bb3588cdfd4d65a88a45 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 9 Dec 2021 09:26:41 +0100 Subject: [PATCH] QVarLengthArray: use C++14 4-arg std::equal() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: MÃ¥rten Nordheim --- src/corelib/tools/qvarlengtharray.h | 7 +------ 1 file changed, 1 insertion(+), 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 friend QTypeTraits::compare_eq_result operator==(const QVarLengthArray &l, const QVarLengthArray &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 friend