-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Enable CA1854 analyser #42008
Copy link
Copy link
Closed
Labels
area-infrastructureIncludes: MSBuild projects/targets, build scripts, CI, Installers and shared frameworkIncludes: MSBuild projects/targets, build scripts, CI, Installers and shared framework
Metadata
Metadata
Assignees
Labels
area-infrastructureIncludes: MSBuild projects/targets, build scripts, CI, Installers and shared frameworkIncludes: MSBuild projects/targets, build scripts, CI, Installers and shared framework
Type
Fields
Give feedbackNo fields configured for issues without a type.
I spotted a new analyser being dogfooded in dotnet/runtime#70157 that suggests using
TryGetValue()on dictionaries overContainsKey()& the indexer.I've spotted a few uses of the latter pattern in the repo from time to time, so it would be good to enable that analyser and fix-up any warnings from it once the relevant change has been ingested into this repo.