Find LINQ Count() on materialized collection

Proprietary

Detect LINQ Count() or Any() on types that have a Count or Length property. Use the property directly for O(1) performance.

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

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