QVarLengthArray: use new assign() in op=(initializer_list)
DRY. Besides, assign() is optimized more. Change-Id: I6c47ed99292d69f887dd187cdc7fef596e2e7d37 Reviewed-by: Dennis Oberst <dennis.oberst@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
parent
d5e98cde1a
commit
af233cb969
@ -379,9 +379,7 @@ public:
|
|||||||
|
|
||||||
QVarLengthArray<T, Prealloc> &operator=(std::initializer_list<T> list)
|
QVarLengthArray<T, Prealloc> &operator=(std::initializer_list<T> list)
|
||||||
{
|
{
|
||||||
resize(qsizetype(list.size()));
|
assign(list);
|
||||||
std::copy(list.begin(), list.end(),
|
|
||||||
QT_MAKE_CHECKED_ARRAY_ITERATOR(begin(), size()));
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user