summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2014-08-26 10:18:47 +0200
committerMarc Mutz <marc.mutz@kdab.com>2014-08-28 09:52:43 +0200
commitf563124eee7e0f58359599a8108ec0fde21477f4 (patch)
treeb617a9846f571988c36bfc77423dfdae29856a14 /src/corelib/tools
parentf90308c0c3c1d888853faf8edc5c40be081dcb6d (diff)
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 <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qlist.h4
1 files changed, 2 insertions, 2 deletions
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<T>::~QList()
template <typename T>
Q_OUTOFLINE_TEMPLATE bool QList<T>::operator==(const QList<T> &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<Node *>(p.end());
Node *b = reinterpret_cast<Node *>(p.begin());
Node *li = reinterpret_cast<Node *>(l.p.end());