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

Do ordinal string comparisons #1193

Merged
merged 1 commit into from
Nov 6, 2023
Merged

Conversation

dawedawe
Copy link
Contributor

@dawedawe dawedawe commented Nov 5, 2023

WHAT

🤖 Generated by Copilot at 15b8219

This pull request changes various string comparison operations in the FsAutoComplete project to use StringComparison.Ordinal instead of the default culture-sensitive option. This improves the performance, consistency, and correctness of the code, as it avoids unnecessary allocations and potential bugs related to different cultures. The changes affect several modules and files, such as CodeGeneration.fs, Commands.fs, CompilerServiceInterface.fs, DocumentationFormatter.fs, InlayHints.fs, Lexer.fs, SignatureFormatter.fs, TestAdapter.fs, TipFormatter.fs, TypedAstUtils.fs, Utils.fs, and some code fixes.

🤖 Generated by Copilot at 15b8219

StringComparison.Ordinal is the way to go
No culture can stop us, we're in control
We generate the code with speed and precision
We fix the bugs with ruthless decision

🚀🛠️📝

WHY

Using Ordinal is both faster and more correct as our intent is to do symbolic compares.
See https://learn.microsoft.com/en-us/dotnet/standard/base-types/best-practices-strings for the full story.

HOW

🤖 Generated by Copilot at 15b8219

faster and more correct as our intent is to do symbolic compares
@TheAngryByrd TheAngryByrd merged commit f7eebb0 into ionide:main Nov 6, 2023
13 checks passed
@dawedawe dawedawe deleted the stringapiusage branch November 6, 2023 15:07
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.

2 participants