summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qmap.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2017-05-21 20:18:34 +0200
committerMarc Mutz <marc.mutz@kdab.com>2017-05-23 08:03:31 +0000
commitf437fb2934e56c293039dc3b00410c53596f9c3e (patch)
tree866f6bed78a92a1bc109668498ab0a0968a92b79 /src/corelib/tools/qmap.h
parent2ff0814aa27be63ae0e10ae84f2820e413b8d015 (diff)
Qt containers: use std::move in take*() methods
Move the objects out of the data structure to avoid needless copies. Change-Id: I1a69fccc431e040b229d6ea9ded0e041c208c861 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/tools/qmap.h')
-rw-r--r--src/corelib/tools/qmap.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h
index 2c19ae969f..9a663c2c20 100644
--- a/src/corelib/tools/qmap.h
+++ b/src/corelib/tools/qmap.h
@@ -956,7 +956,7 @@ Q_OUTOFLINE_TEMPLATE T QMap<Key, T>::take(const Key &akey)
Node *node = d->findNode(akey);
if (node) {
- T t = node->value;
+ T t = std::move(node->value);
d->deleteNode(node);
return t;
}