summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qvector.h
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2019-02-10 18:43:05 +0100
committerMarc Mutz <marc.mutz@kdab.com>2019-06-10 05:12:08 +0000
commitb3c52e82245f46af9ce633a6de1e4e41fb9f3f6d (patch)
tree1a7c249f53ae82408b940608eca88f2677c14223 /src/corelib/tools/qvector.h
parentb16fab1b636c94cb1fd723f46a1714e010a4dc54 (diff)
Simplify {to,from}Std{List,Vector}
Use the newly-added range constructors. Change-Id: I7f1d2699d88656fb7dddd11a9d781d810d45b0b4 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/corelib/tools/qvector.h')
-rw-r--r--src/corelib/tools/qvector.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index c223e4efa0..5d68a283bd 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -303,7 +303,7 @@ public:
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
Q_DECL_DEPRECATED_X("Use QVector<T>(vector.begin(), vector.end()) instead.")
static inline QVector<T> fromStdVector(const std::vector<T> &vector)
- { QVector<T> tmp; tmp.reserve(int(vector.size())); std::copy(vector.begin(), vector.end(), std::back_inserter(tmp)); return tmp; }
+ { return QVector<T>(vector.begin(), vector.end()); }
Q_DECL_DEPRECATED_X("Use std::vector<T>(vector.begin(), vector.end()) instead.")
inline std::vector<T> toStdVector() const
{ return std::vector<T>(d->begin(), d->end()); }