Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICU-13786 Fix addLikelySubtags/minimizeSubtags #1140

Merged

Conversation

FrankYFTang
Copy link
Contributor

@FrankYFTang FrankYFTang commented Apr 29, 2020

  1. Add test cases in C++ from Java.
  2. Add test cases in C++ and Java from examples of UTS35 and
    https://github.com/tc39/test262/blob/master/test/intl402/Locale/prototype/minimize/removing-likely-subtags-first-adds-likely-subtags.js
  3. Fix C++ code:
    a) Make _ulocimp_addLikelySubtags propagate matching error so
    minimizeSubtags can just return the no matching case unchanged.
    b) rename the sink variable to outSink and local sink variables to
    avoid confusion and mistake
    c) Correct the implementation of minimizeSubtags by using the lang,
    region, script of the "max" instead of the localeID in the algorithm.
Checklist

@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • icu4c/source/common/loclikely.cpp is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • icu4c/source/test/cintltst/cloctst.c is now changed in the branch

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

icu4c/source/common/loclikely.cpp Show resolved Hide resolved
icu4c/source/common/loclikely.cpp Outdated Show resolved Hide resolved
icu4c/source/common/loclikely.cpp Outdated Show resolved Hide resolved
icu4c/source/common/loclikely.cpp Show resolved Hide resolved
icu4c/source/common/loclikely.cpp Show resolved Hide resolved
icu4c/source/common/loclikely.cpp Show resolved Hide resolved
icu4c/source/common/loclikely.cpp Outdated Show resolved Hide resolved
icu4c/source/common/loclikely.cpp Outdated Show resolved Hide resolved
icu4c/source/common/loclikely.cpp Show resolved Hide resolved
icu4c/source/common/loclikely.cpp Outdated Show resolved Hide resolved
icu4c/source/common/loclikely.cpp Show resolved Hide resolved
@FrankYFTang
Copy link
Contributor Author

PTAL I change the name of "outSink" back to "sink" but keep my other rename of "sink" of local variable as baseSink, tagSink and so on so it is clear which one is the local one and which one is the 'sink' which intend for the output. I also change the nullptr back to NULL as requested by roubert.

@FrankYFTang FrankYFTang requested a review from roubert May 8, 2020 21:50
@FrankYFTang
Copy link
Contributor Author

ping

1 similar comment
@FrankYFTang
Copy link
Contributor Author

ping

Copy link
Member

@markusicu markusicu left a comment

Choose a reason for hiding this comment

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

lgtm pse squash

icu4c/source/common/loclikely.cpp Show resolved Hide resolved
icu4c/source/common/loclikely.cpp Show resolved Hide resolved
icu4c/source/common/loclikely.cpp Show resolved Hide resolved
@jira-pull-request-webhook
Copy link

Hooray! The files in the branch are the same across the force-push. 😃

~ Your Friendly Jira-GitHub PR Checker Bot

Copy link
Member

@markusicu markusicu left a comment

Choose a reason for hiding this comment

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

lgtm

@FrankYFTang FrankYFTang dismissed roubert’s stale review May 28, 2020 01:36

cannot figure out which one is not addressed in the newer version

@FrankYFTang FrankYFTang merged commit ec7e29f into unicode-org:master May 28, 2020
@FrankYFTang FrankYFTang deleted the ICU-13786-addLikelySubtags branch June 4, 2020 23:25
kishiguro pushed a commit to kishiguro/icu that referenced this pull request Jun 16, 2020
ICU-13786 Fix addLikelySubtags/minimizeSubtags #1140

Bug: https://unicode-org.atlassian.net/browse/ICU-13786
PR: unicode-org/icu#1140

Bug: v8:10448
Change-Id: Id5e8b0037bbe76941fa89f7564d49cf27a990b2e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/deps/icu/+/2231777
Reviewed-by: Jungshik Shin <jshin@chromium.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants