QVarLengthArray: use assign() for the iterator,iterator ctor
Let's avoid std::back_inserter for non-complex types, which generates a huge amount of unnecessary code. The implementation of assign() is far more modern. Change-Id: Ia8b9c90336af2bebd49ffffd0d69ace761c6aa59 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io> (cherry picked from commit 96dfe0373c80964ae9de7955a06f5c7696961f12) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
8bb365b0c5
commit
ee95cb90c4
@ -360,8 +360,7 @@ public:
|
|||||||
inline QVarLengthArray(InputIterator first, InputIterator last)
|
inline QVarLengthArray(InputIterator first, InputIterator last)
|
||||||
: QVarLengthArray()
|
: QVarLengthArray()
|
||||||
{
|
{
|
||||||
QtPrivate::reserveIfForwardIterator(this, first, last);
|
assign(first, last);
|
||||||
std::copy(first, last, std::back_inserter(*this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline ~QVarLengthArray()
|
inline ~QVarLengthArray()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user