summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2020-10-12 17:28:03 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2020-10-23 11:34:30 +0200
commit34d3f2e21921a7eef8f6241a178598f9eaf0a8a9 (patch)
tree107bc21ce9da7b116c6fbd01e88e13ef05ac0ee7 /src
parent560d48730bf69a1fd9ba5ebf888c8e52d50261f2 (diff)
Fix QLocale's findLocaleDataById(): skip likely sub-tag look-up
It was always called in pairs, first with likely sub-tags added, then with the base that started from. So doing a likely sub-tag lookup inside the function was redundant for the former while making the latter redundant - and it's needed. Task-number: QTBUG-84669 Change-Id: I18bf1d4976a51d9436efd20d1a84a36cfc60f618 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 55e16b25f52fdd1b945d3f94d79ce85d88cb69ec) Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/text/qlocale.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp
index 3a9577a385..7dce860354 100644
--- a/src/corelib/text/qlocale.cpp
+++ b/src/corelib/text/qlocale.cpp
@@ -361,11 +361,8 @@ QByteArray QLocalePrivate::rawName(char separator) const
return parts.join(separator);
}
-
-static const QLocaleData *findLocaleDataById(const QLocaleId &lid)
+static const QLocaleData *findLocaleDataById(const QLocaleId &localeId)
{
- QLocaleId localeId = lid.withLikelySubtagsAdded();
-
const uint idx = locale_index[localeId.language_id];
const QLocaleData *data = locale_data + idx;