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>
bb10
Marc Mutz 2014-08-26 10:18:47 +02:00
parent f90308c0c3
commit f563124eee
1 changed files with 2 additions and 2 deletions

View File

@ -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());