Skip to content

Commit

Permalink
Update loclikelysubtags.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
sffc authored Oct 27, 2023
1 parent 96bf4bf commit 063a23b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions icu4c/source/common/loclikelysubtags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ static void processMacroregionRange(const UnicodeString& regionName, UVector* ne
}
}

#if U_DEBUG
UVector* loadMacroregions(UErrorCode &status) {
LocalPointer<UVector> newMacroRegions(new UVector(uprv_deleteUObject, uhash_compareUnicodeString, status), status);

Expand All @@ -420,6 +421,7 @@ UVector* loadMacroregions(UErrorCode &status) {

return newMacroRegions.orphan();
}
#endif // U_DEBUG

UVector* getStaticMacroregions(UErrorCode &status) {
LocalPointer<UVector> newMacroRegions(new UVector(uprv_deleteUObject, uhash_compareUnicodeString, status), status);
Expand All @@ -428,8 +430,8 @@ UVector* getStaticMacroregions(UErrorCode &status) {
return nullptr;
}

for (size_t i=0; i<UPRV_LENGTHOF(MACROREGION_HARDCODE); i++) {
UnicodeString regionName(MACROREGION_HARDCODE[i]);
for (const auto *region : MACROREGION_HARDCODE) {
UnicodeString regionName(region);
processMacroregionRange(regionName, newMacroRegions.getAlias(), status);
if (U_FAILURE(status)) {
return nullptr;
Expand Down Expand Up @@ -479,7 +481,7 @@ XLikelySubtags::XLikelySubtags(XLikelySubtagsData &data) :
lsrs(data.lsrs),
#if U_DEBUG
lsrsLength(data.lsrsLength),
#endif
#endif // U_DEBUG
distanceData(std::move(data.distanceData)) {
data.langInfoBundle = nullptr;
data.lsrs = nullptr;
Expand Down

0 comments on commit 063a23b

Please sign in to comment.