summaryrefslogtreecommitdiffstats
path: root/src/corelib
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-19 17:45:12 +0200
commit55e16b25f52fdd1b945d3f94d79ce85d88cb69ec (patch)
treec8ecfee8b819332b5f7a4cdfe8b6b301deee543c /src/corelib
parent78b58d4de1cceb538cc3983346383440734b00b4 (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 Pick-to: 5.15 Change-Id: I18bf1d4976a51d9436efd20d1a84a36cfc60f618 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/text/qlocale.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp
index 8b4e60f2ca..59dd3c589d 100644
--- a/src/corelib/text/qlocale.cpp
+++ b/src/corelib/text/qlocale.cpp
@@ -359,10 +359,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];
if (idx == 0) // default language has no associated script or country
return locale_data;