Bug 1509849 - Revert the followup from bug 1503157 now that an empty locale string is handled properly by the Locale constructor. r=gandalf
authorJonathan Kew <jkew@mozilla.com>
Mon, 26 Nov 2018 19:25:28 +0000
changeset 504489 2fdce5544015e6b150cfdad4921eab0dbd11be93
parent 504488 e8eaf7539ccb57dece538a004d9f22e932f8e244
child 504490 513b8b0d5683f4b332b107dd9b1135f56bc9d7c5
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgandalf
bugs1509849, 1503157
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1509849 - Revert the followup from bug 1503157 now that an empty locale string is handled properly by the Locale constructor. r=gandalf
intl/locale/nsLanguageAtomService.cpp
--- a/intl/locale/nsLanguageAtomService.cpp
+++ b/intl/locale/nsLanguageAtomService.cpp
@@ -178,17 +178,17 @@ nsLanguageAtomService::GetUncachedLangua
     if (BinarySearchIf(kLangGroups, 0, ArrayLength(kLangGroups),
                        [&langStr](const char* tag) -> int {
                          return langStr.Compare(tag);
                        },
                        &unused)) {
       langGroup = NS_Atomize(langStr);
       return langGroup.forget();
     }
-  } else if (!langStr.IsEmpty()) {
+  } else {
     // If the lang code can be parsed as BCP47, look up its (likely) script
     Locale loc(langStr);
     if (loc.IsWellFormed()) {
       if (loc.GetScript().IsEmpty()) {
         loc.AddLikelySubtags();
       }
       if (loc.GetScript().EqualsLiteral("Hant")) {
         if (loc.GetRegion().EqualsLiteral("HK")) {