Skip to content

Commit

Permalink
ICU-20777 Merge the likelySubtags implemention
Browse files Browse the repository at this point in the history
Change testdata/likelySubtags.txt to consider FAIL line

ICU-20777 Fix Java Tests

ICU-20777 Fix all issues

ICU-20777 Incase timeout

ICU-20777

ICU-20777 Skip Data Driven test
  • Loading branch information
FrankYFTang committed Aug 18, 2023
1 parent 27181e3 commit ffc449d
Show file tree
Hide file tree
Showing 24 changed files with 3,956 additions and 1,491 deletions.
2 changes: 2 additions & 0 deletions icu4c/source/common/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,9 @@ cc_library(
"locbased.cpp",
"locid.cpp",
"loclikely.cpp",
"loclikelysubtags.cpp",
"locmap.cpp",
"lsr.cpp",
"resbund.cpp",
"resource.cpp",
"uloc.cpp",
Expand Down
2 changes: 1 addition & 1 deletion icu4c/source/common/localematcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ LSR getMaximalLsrOrUnd(const XLikelySubtags &likelySubtags, const Locale &locale
if (U_FAILURE(errorCode) || locale.isBogus() || *locale.getName() == 0 /* "und" */) {
return UND_LSR;
} else {
return likelySubtags.makeMaximizedLsrFrom(locale, errorCode);
return likelySubtags.makeMaximizedLsrFrom(locale, false, errorCode);
}
}

Expand Down
6 changes: 5 additions & 1 deletion icu4c/source/common/locid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2080,14 +2080,18 @@ Locale::addLikelySubtags(UErrorCode& status) {

void
Locale::minimizeSubtags(UErrorCode& status) {
Locale::minimizeSubtags(false, status);
}
void
Locale::minimizeSubtags(bool favorScript, UErrorCode& status) {
if (U_FAILURE(status)) {
return;
}

CharString minimizedLocaleID;
{
CharStringByteSink sink(&minimizedLocaleID);
ulocimp_minimizeSubtags(fullName, sink, &status);
ulocimp_minimizeSubtags(fullName, sink, favorScript, &status);
}

if (U_FAILURE(status)) {
Expand Down
Loading

1 comment on commit ffc449d

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: ffc449d Previous: 27181e3 Ratio
TestCharsetEncoderICU 5.934485081089446 ns/iter 2.825688392316868 ns/iter 2.10

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.