From 0d2791c5f64fcb7f0ce4c2027d78fc39de514ab4 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 6 Feb 2017 10:14:29 +0100 Subject: QCollatorSortKey: add some std::move All implementations of QCollator::sortKey() can benefit from moving their CollatorKeyType into the QCollatorSortKeyPrivate on construction. So make the QCollatorSortKeyPrivate ctor a perfect forwarder for its m_key member, and add std::move() calls where they were missing (in all but one case, lvalues were passed). Make the ctor explicit, as it should have been from the beginning. Change-Id: I2a1cdda5fd23990ace019b963df895c621a1fa85 Reviewed-by: Lars Knoll --- src/corelib/tools/qcollator_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/tools/qcollator_win.cpp') diff --git a/src/corelib/tools/qcollator_win.cpp b/src/corelib/tools/qcollator_win.cpp index 44beaeaf75..bce896278e 100644 --- a/src/corelib/tools/qcollator_win.cpp +++ b/src/corelib/tools/qcollator_win.cpp @@ -147,7 +147,7 @@ QCollatorSortKey QCollator::sortKey(const QString &string) const if (finalSize == 0) { qWarning() << "there were problems when generating the ::sortKey by LCMapStringW with error:" << GetLastError(); } - return QCollatorSortKey(new QCollatorSortKeyPrivate(ret)); + return QCollatorSortKey(new QCollatorSortKeyPrivate(std::move(ret))); } int QCollatorSortKey::compare(const QCollatorSortKey &otherKey) const -- cgit v1.2.3