From f563124eee7e0f58359599a8108ec0fde21477f4 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 26 Aug 2014 10:18:47 +0200 Subject: QList: check d for equality before d->size for inequality Same change as was already applied to QVector::operator==(). Change-Id: Ic2e140a52ee95f2e215668077951de0b4450d194 Reviewed-by: Olivier Goffart --- src/corelib/tools/qlist.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/tools') diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 6e0634ac3b..b927bf1ead 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -774,10 +774,10 @@ Q_OUTOFLINE_TEMPLATE QList::~QList() template Q_OUTOFLINE_TEMPLATE bool QList::operator==(const QList &l) const { - if (p.size() != l.p.size()) - return false; if (d == l.d) return true; + if (p.size() != l.p.size()) + return false; Node *i = reinterpret_cast(p.end()); Node *b = reinterpret_cast(p.begin()); Node *li = reinterpret_cast(l.p.end()); -- cgit v1.2.3