Move existing items in generic erase instead of copying them

Use std::move() in QGenericArrayOps::erase() when assigning over the
to-be-deleted range

Task-number: QTBUG-86583
Change-Id: Ib28c5c1f1593beba5fce6841dd6fcecfdfb166ad
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Andrei Golubev 2020-11-04 12:26:08 +01:00
parent 1d309843a1
commit b3a5ad40a7
1 changed files with 2 additions and 2 deletions

View File

@ -802,7 +802,7 @@ public:
// move (by assignment) the elements from e to end
// onto b to the new end
while (e != end) {
*b = *e;
*b = std::move(*e);
++b;
++e;
}
@ -830,7 +830,7 @@ public:
while (b != begin) {
--b;
--e;
*e = *b;
*e = std::move(*b);
}
// destroy the final elements at the begin