summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qlocale_unix.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2024-04-05 15:50:19 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2024-04-09 16:41:27 +0200
commitb68f1009187fee473f4c6477ec64300650e29904 (patch)
tree8a5df70735f28b2ed122312434b12abf7a498fa1 /src/corelib/text/qlocale_unix.cpp
parent21ef6d930ad3eb2fb435cd601692cb5cc1726bd8 (diff)
Pass QVariant to QSystemLocale::query() as rvalue reference
QVariant is rather big for passing by value; and no caller has any further use for the QVariant it's passing in. Pick-to: 6.7 6.5 Task-number: QTBUG-122619 Change-Id: I2751745e715aacfa8982ac97b4ae777fde5e88de Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qlocale_unix.cpp')
-rw-r--r--src/corelib/text/qlocale_unix.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/corelib/text/qlocale_unix.cpp b/src/corelib/text/qlocale_unix.cpp
index db4108fb71..a934f24c01 100644
--- a/src/corelib/text/qlocale_unix.cpp
+++ b/src/corelib/text/qlocale_unix.cpp
@@ -124,7 +124,7 @@ QLocale QSystemLocale::fallbackLocale() const
return QLocale(lang);
}
-QVariant QSystemLocale::query(QueryType type, QVariant in) const
+QVariant QSystemLocale::query(QueryType type, QVariant &&in) const
{
QSystemLocaleData *d = qSystemLocaleData();
@@ -258,9 +258,10 @@ QVariant QSystemLocale::query(QueryType type, QVariant in) const
return d->uiLanguages.isEmpty() ? QVariant() : QVariant(d->uiLanguages);
}
case StringToStandardQuotation:
- return lc_messages.quoteString(qvariant_cast<QStringView>(in));
+ return lc_messages.quoteString(qvariant_cast<QStringView>(std::move(in)));
case StringToAlternateQuotation:
- return lc_messages.quoteString(qvariant_cast<QStringView>(in), QLocale::AlternateQuotation);
+ return lc_messages.quoteString(qvariant_cast<QStringView>(std::move(in)),
+ QLocale::AlternateQuotation);
case ListToSeparatedString:
return lc_messages.createSeparatedList(in.toStringList());
case LocaleChanged: