summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qlinkedlist.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/qlinkedlist.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/qlinkedlist.h')
-rw-r--r--src/corelib/tools/qlinkedlist.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/tools/qlinkedlist.h b/src/corelib/tools/qlinkedlist.h
index 249f76dafd..9f54ba7825 100644
--- a/src/corelib/tools/qlinkedlist.h
+++ b/src/corelib/tools/qlinkedlist.h
@@ -448,7 +448,7 @@ bool QLinkedList<T>::removeOne(const T &_t)
template <typename T>
inline T QLinkedList<T>::takeFirst()
{
- T t = first();
+ T t = std::move(first());
removeFirst();
return t;
}
@@ -456,7 +456,7 @@ inline T QLinkedList<T>::takeFirst()
template <typename T>
inline T QLinkedList<T>::takeLast()
{
- T t = last();
+ T t = std::move(last());
removeLast();
return t;
}