summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qlocale.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2024-04-05 16:50:47 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2024-04-09 16:41:27 +0200
commit738914e787c5a2de57f40753b665e2a49f9536d3 (patch)
tree6eef170e226ce522e90555d91f87e8bc29f01c20 /src/corelib/text/qlocale.cpp
parente1da249be602322c3e4b84ba23748c1c1c8db888 (diff)
Pass trivially-copyable types by value, not by const ref
The LikelyPair and QLocaleId types are small enough to pass by value. Pick-to: 6.7 6.5 Task-number: QTBUG-122619 Change-Id: I1502efcf69ac82d9c49b673975502882c59a4fd0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qlocale.cpp')
-rw-r--r--src/corelib/text/qlocale.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp
index 2efc1ef79e..d2550fadff 100644
--- a/src/corelib/text/qlocale.cpp
+++ b/src/corelib/text/qlocale.cpp
@@ -252,7 +252,7 @@ struct LikelyPair
QLocaleId value = QLocaleId { 0, 0, 0 };
};
-bool operator<(const LikelyPair &lhs, const LikelyPair &rhs)
+bool operator<(LikelyPair lhs, LikelyPair rhs)
{
// Must match the comparison LocaleDataWriter.likelySubtags() uses when
// sorting, see qtbase/util/locale_database.qlocalexml2cpp.py
@@ -465,7 +465,7 @@ QByteArray QLocalePrivate::bcp47Name(char separator) const
return m_data->id().withLikelySubtagsRemoved().name(separator);
}
-static qsizetype findLocaleIndexById(const QLocaleId &localeId)
+static qsizetype findLocaleIndexById(QLocaleId localeId)
{
qsizetype idx = locale_index[localeId.language_id];
// If there are no locales for specified language (so we we've got the