summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrei Golubev <andrei.golubev@qt.io>2020-11-04 12:26:08 +0100
committerAndrei Golubev <andrei.golubev@qt.io>2020-11-09 17:36:13 +0100
commitb3a5ad40a752e2e6036aaed2b30a80e73a6c779f (patch)
tree1e6f7619878c0dcd0f8be34978930e3a494caf3b /src
parent1d309843a1df3082a5c989a2bb46fd0b8e01f83a (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qarraydataops.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/tools/qarraydataops.h b/src/corelib/tools/qarraydataops.h
index 0e067bbbe5..7c12a84c10 100644
--- a/src/corelib/tools/qarraydataops.h
+++ b/src/corelib/tools/qarraydataops.h
@@ -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