-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
add OSPlatform.macOS, switch to OrdinalIgnoreCase for OSPlatform comparisons #39209
Conversation
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I'm going to add @jkotas as a reviewer too though; we should wait for his approval before merging.
...Information/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.Unix.cs
Outdated
Show resolved
Hide resolved
...vices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/OSPlatform.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
...Information/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.Unix.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
...vices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/OSPlatform.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Thanks, @adamsitnik and @jkotas! |
I tried to introduce as small overhead as possible.
On Windows, there is basically no difference. On OSX there is no difference for "OSX" (old check), but the "macOS" check takes twice the time because we need two comparisons.
I've added the test cases that were missing in #39005 (ignore case comparison was not enabled then)
Windows
Before:
After:
OSX
Before:
After: