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

fix: Use ordinal comparisons for string operations #2546

Merged
merged 5 commits into from
Sep 25, 2023

Conversation

jskeet
Copy link
Collaborator

@jskeet jskeet commented Sep 22, 2023

No description provided.

@jskeet jskeet changed the title Use ordinal comparisons for string operations fix: Use ordinal comparisons for string operations Sep 22, 2023

Verified

This commit was signed with the committer’s verified signature.
rajatvig Rajat Vig
@jskeet
Copy link
Collaborator Author

jskeet commented Sep 22, 2023

Notes on changes I haven't made:

  • == uses ordinal comparisons
  • string.Equals(string) uses ordinal comparisons by default
  • string.Contains(string) uses ordinal comparisons
  • StringComparer.Default (the default comparer for dictionaries etc) uses ordinal comparisons

@jskeet jskeet marked this pull request as ready for review September 22, 2023 09:04
@jskeet jskeet requested a review from a team as a code owner September 22, 2023 09:04
@jskeet
Copy link
Collaborator Author

jskeet commented Sep 22, 2023

(I haven't added a test for every change. I suspect doing that would be too unwieldy as a long-term plan. Explicitly running all the tests in multiple cultures might not be a bad idea though.)

Copy link
Contributor

@amanda-tarafa amanda-tarafa left a comment

Choose a reason for hiding this comment

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

Yep, this looks good.

I'll take a look at running tests in several cultures.

@jskeet jskeet merged commit a7d5698 into googleapis:main Sep 25, 2023
@jskeet jskeet deleted the string-operations branch September 25, 2023 07:27
amanda-tarafa added a commit that referenced this pull request Sep 25, 2023
Bugs:

* #2546 Which uses ordinal comparisons for string operations.
amanda-tarafa added a commit that referenced this pull request Sep 25, 2023
Bugs:

* #2546 Which uses ordinal comparisons for string operations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants