From 55e16b25f52fdd1b945d3f94d79ce85d88cb69ec Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 12 Oct 2020 17:28:03 +0200 Subject: 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 --- src/corelib/text/qlocale.cpp | 4 +--- 1 file changed, 1 insertion(+), 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; -- cgit v1.2.3