Optimize LINQ Where().Count()
ProprietaryReplace items.Where(predicate).Count() with items.Count(predicate). Passing the predicate directly to Count avoids an intermediate iterator.
OpenRewrite. Recipes. CSharp. CodeQuality. Linq. OptimizeLinqWhereCountmod run . --recipe= OpenRewrite. Recipes. CSharp. CodeQuality. Linq. OptimizeLinqWhereCountInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.