-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Fix warnings found with new analyzer CA1860: Prefer Length/Count/IsEmpty property check over Any() #81583
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
…y property support
Tagging subscribers to this area: @dotnet/area-meta Issue Details
|
@@ -468,6 +468,9 @@ dotnet_diagnostic.CA1858.severity = warning | |||
# CA1859: Use concrete types when possible for improved performance | |||
dotnet_diagnostic.CA1859.severity = warning |
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.
Do things get out of hand if you turn on analysis of internal stuff too?
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.
By default it's only private and you can opt-in to internal as well? We should definitely aim to opt in.
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.
Yes, the default is private and you can opt-in to internal and public too.
Support for internal and public is in a PR that is about to be merged: dotnet/roslyn-analyzers#6421
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.
Yes, I tried with internal a lot flagged that looks valid, now dotnet/roslyn-analyzers#6421 is merged, probably better wait until it is ready for consumption for the repo before enable the internal API surface
src/libraries/System.Net.Http/src/System/Net/Http/HttpClientHandler.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.
Changes generally look good, but there are more places that need to be fixed as CI highlights.
Prefer Length/Count/IsEmpty property check over Any()
, and updated its severity.