diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 8b0804e5df..ab48ae5ea3 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -791,12 +791,9 @@ int QVector::lastIndexOf(const T &t, int from) const template bool QVector::contains(const T &t) const { - T* i = d->begin(); - T* e = d->end(); - for (; i != e; ++i) - if (*i == t) - return true; - return false; + const T *b = d->begin(); + const T *e = d->end(); + return std::find(b, e, t) != e; } template