Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Add support for String CompareOptions on Unix #2196

Merged
merged 6 commits into from
Dec 10, 2015

Conversation

eerhardt
Copy link
Member

@eerhardt eerhardt commented Dec 1, 2015

Adding support for IgnoreNonSpace, IgnoreSymbols, IgnoreKanaType and IgnoreWidth on Unix. The only option left undone is StringSort, which will be implemented in a future commit.

This is a partial fix for https://github.com/dotnet/corefx/issues/3858.

@ellismg @stephentoub @tarekgh

{
pthread_mutex_init(&collatorsLockObject, NULL);
Copy link
Member

Choose a reason for hiding this comment

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

Does the mutex need to be cleaned up when we're done with it with pthread_mutex_destroy?

Copy link
Member Author

Choose a reason for hiding this comment

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

DOH. My mistake. Will add this to CloseSortHandle. Thanks for the catch.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've fixed this in the latest commit.

Choose a reason for hiding this comment

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

Assert the return value for success?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added.

@ellismg
Copy link

ellismg commented Dec 1, 2015

LGTM. Thanks for doing this, Eric!

const int32_t CompareOptionsIgnoreNonSpace = 2;
const int32_t CompareOptionsIgnoreSymbols = 4;
const int32_t CompareOptionsIgnoreKanaType = 8;
const int32_t CompareOptionsIgnoreWidth = 0x10;

Choose a reason for hiding this comment

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

a nit, but IMO using 0x across all options would be more straightforward to signify bitwise fields

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed.

@eerhardt
Copy link
Member Author

eerhardt commented Dec 3, 2015

I've addressed all feedback. Thanks everyone. Unless more is received, I'll merge this change tomorrow around noon.

@eerhardt
Copy link
Member Author

eerhardt commented Dec 4, 2015

@dotnet-bot test this please

@eerhardt eerhardt force-pushed the CompareOptions2 branch 2 times, most recently from 5492baf to 6162dea Compare December 9, 2015 03:00
@eerhardt
Copy link
Member Author

eerhardt commented Dec 9, 2015

My previous code was broken on OSX (ICU 55.1). I fixed that issue, with lots of help from @markusicu. I did some more testing on Windows, and had to make a couple more changes to the rules. See the latest commit.

@ellismg @steveharter - Can you take a look?

@eerhardt
Copy link
Member Author

eerhardt commented Dec 9, 2015

@dotnet-bot test this please

1. When IgnoreSymbols is true, ensure we still ignore half and fullwidth characters that are symbols.
2. Hiragana-Katakana characters differ at the tertiary strength, fixing the rule.
3. Fix collation on OSX which uses ICU 55.1.
ICU 55 doesn't support having certain unicode characters using primary '<' rules.
These characters are not necessary in the rules, since Windows always treats them the same.
Removing 0x3099 and 0x309A from the half/full width rules.
@eerhardt
Copy link
Member Author

eerhardt commented Dec 9, 2015

@dotnet-bot test this please

1 similar comment
@eerhardt
Copy link
Member Author

eerhardt commented Dec 9, 2015

@dotnet-bot test this please

@eerhardt
Copy link
Member Author

eerhardt commented Dec 9, 2015

Test Ubuntu x64 Release Build and Test please

@eerhardt
Copy link
Member Author

eerhardt commented Dec 9, 2015

@dotnet-bot test this please

2 similar comments
@eerhardt
Copy link
Member Author

@dotnet-bot test this please

@eerhardt
Copy link
Member Author

@dotnet-bot test this please

@eerhardt
Copy link
Member Author

OSX CI still seems broken. Merging.

eerhardt added a commit that referenced this pull request Dec 10, 2015
Add support for String CompareOptions on Unix
@eerhardt eerhardt merged commit 15706eb into dotnet:master Dec 10, 2015
@eerhardt eerhardt deleted the CompareOptions2 branch December 10, 2015 15:11
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Add support for String CompareOptions on Unix

Commit migrated from dotnet/coreclr@15706eb
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants