]> granicus.if.org Git - icu/commitdiff
ICU-21009 LocaleMatcher() order[] always set all elements
authorMarkus Scherer <markus.icu@gmail.com>
Fri, 13 Mar 2020 22:04:11 +0000 (15:04 -0700)
committerMarkus Scherer <markus.icu@gmail.com>
Sat, 14 Mar 2020 21:07:29 +0000 (14:07 -0700)
icu4c/source/common/localematcher.cpp

index 2cce3f4b5748bf9199f698e0f59e8b84d30d923e..7f0dceb66ae6763377fcdce22e75d4ec9ef740dd 100644 (file)
@@ -421,8 +421,10 @@ LocaleMatcher::LocaleMatcher(const Builder &builder, UErrorCode &errorCode) :
                 U_ASSERT(i == 0);
                 def = &locale;
                 defLSR = &lsr;
+                order[i] = 1;
                 suppLength = putIfAbsent(lsr, 0, suppLength, errorCode);
             } else if (lsr.isEquivalentTo(*defLSR)) {
+                order[i] = 1;
                 suppLength = putIfAbsent(lsr, i, suppLength, errorCode);
             } else if (localeDistance.isParadigmLSR(lsr)) {
                 order[i] = 2;