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>
This commit is contained in:
parent
78b58d4de1
commit
55e16b25f5
@ -359,10 +359,8 @@ QByteArray QLocalePrivate::rawName(char separator) const
|
|||||||
return parts.join(separator);
|
return parts.join(separator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const QLocaleData *findLocaleDataById(const QLocaleId &localeId)
|
||||||
static const QLocaleData *findLocaleDataById(const QLocaleId &lid)
|
|
||||||
{
|
{
|
||||||
QLocaleId localeId = lid.withLikelySubtagsAdded();
|
|
||||||
const uint idx = locale_index[localeId.language_id];
|
const uint idx = locale_index[localeId.language_id];
|
||||||
if (idx == 0) // default language has no associated script or country
|
if (idx == 0) // default language has no associated script or country
|
||||||
return locale_data;
|
return locale_data;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user