From 5ec57560c0b497f9f48671dd200bb23d1f6eac35 Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Wed, 29 Mar 2017 07:10:46 +0300 Subject: Prefer rvalue versions of toLatin() and toUtf8() ... to re-use existing buffers. Change-Id: I7c42529b8cd4400520a59e658ab76f4f8e965cd4 Reviewed-by: Thiago Macieira --- src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/tools') diff --git a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp index cdf3ad3310..9ccf8be73a 100644 --- a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp +++ b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp @@ -217,7 +217,7 @@ static QByteArray qtTypeName(const QString &signature, const QDBusIntrospection: annotationName += QString::fromLatin1(".%1%2").arg(QLatin1String(direction)).arg(paramId); QString qttype = annotations.value(annotationName); if (!qttype.isEmpty()) - return qttype.toLatin1(); + return std::move(qttype).toLatin1(); QString oldAnnotationName = QString::fromLatin1("com.trolltech.QtDBus.QtTypeName"); if (paramId >= 0) @@ -242,7 +242,7 @@ static QByteArray qtTypeName(const QString &signature, const QDBusIntrospection: "suggest updating to '%s'\n", PROGRAMNAME, qPrintable(oldAnnotationName), qPrintable(inputFile), qPrintable(annotationName)); - return qttype.toLatin1(); + return std::move(qttype).toLatin1(); } return QVariant::typeToName(QVariant::Type(type)); -- cgit v1.2.3