summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qvector.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index c547cec7be..f09f1a3c41 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -810,13 +810,7 @@ bool QVector<T>::contains(const T &t) const
template <typename T>
int QVector<T>::count(const T &t) const
{
- int c = 0;
- T* b = d->begin();
- T* i = d->end();
- while (i != b)
- if (*--i == t)
- ++c;
- return c;
+ return int(std::count(cbegin(), cend(), t));
}
template <typename T>