-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Use char overloads to Join/Index strings #56531
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
Conversation
Use overloads that take a `char` for single-character strings.
e46a36f
to
ea196a1
Compare
CI failure looks unrelated - that analyzer has been failing in a lot of runs. Edit: Oh fancy, we have a bot to tag known failures now? |
@@ -179,17 +179,17 @@ public static BindingAddress Parse(string address) | |||
} | |||
} | |||
|
|||
pathDelimiterStart = address.IndexOf(":", schemeDelimiterEnd + unixPipeHostPrefixLength, StringComparison.Ordinal); |
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.
Not your fault, but it seems very weird that the char version doesn't (AFAICT) accept a StringComparison
. I'm assuming the default is Ordinal
?
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.
I'll double-check this one locally in an IDE.
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.
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.
Sorry, I should have been clearer - there isn't a better overload you could have called. I don't know why that is, but you don't need to do anything about it.
I just confirmed in the source that the default comparison is Ordinal
so the change looks correct (if, sadly, less explicit).
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Pull request was closed
Use char overloads to Join/Index strings
Use overloads that take a
char
for single-character strings.Description
Use overloads that take a
char
for single-character strings where relevant withstring.Join()
or{Last}IndexOf()
to resolve a number of analyser suggestions.Also fixes a few IDE0055 diagnostics.