diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 326a276f40..b56afe15c2 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -770,11 +770,10 @@ Q_OUTOFLINE_TEMPLATE bool QList::operator==(const QList &l) const 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()); - while (i != b) { - --i; --li; + Node *i = reinterpret_cast(p.begin()); + Node *e = reinterpret_cast(p.end()); + Node *li = reinterpret_cast(l.p.begin()); + for (; i != e; ++i, ++li) { if (!(i->t() == li->t())) return false; }