Use ContainsKey instead of Keys.Contains

Proprietary

Replace .Keys.Contains(key) with .ContainsKey(key) on dictionaries for O(1) performance.

OpenRewrite.Recipes.CSharp.CodeQuality.Performance.UseContainsKey
mod run . --recipe=OpenRewrite.Recipes.CSharp.CodeQuality.Performance.UseContainsKey

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.