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

use char base startswith and endswith #10341

Merged

Conversation

SimonCropp
Copy link
Contributor

has better perf

@filzrev
Copy link
Contributor

filzrev commented Nov 3, 2024

These modifications seems to corresponding to following Code Analyzer Rules

I thought it might be better to change these rules category from suggestion to warning at .editorconfig file.
By these changes. It can enforce rules for future code modifications.
And it can automatically refactoring code by executing dotnet format analyzers command.

Example settings for .editorconfig

#----------------------------------------------
# CodeAnalyzer Rules
#----------------------------------------------
[*.{cs}]

# Performance rules
dotnet_diagnostic.CA1865.severity = warning # CA1865: Use 'string.Method(char)' instead of 'string.Method(string)' for string with single char
dotnet_diagnostic.CA1866.severity = warning # CA1866: Use 'string.Method(char)' instead of 'string.Method(string)' for string with single char

@yufeih yufeih merged commit 793eef1 into dotnet:main Nov 4, 2024
7 checks passed
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.

3 participants