Use Any() instead of Count() > 0

Proprietary

Replace .Count() > 0 with .Any(). Any() short-circuits after the first match, while Count() enumerates all elements.

OpenRewrite.Recipes.CSharp.CodeQuality.Linq.UseAnyInsteadOfCount
mod run . --recipe=OpenRewrite.Recipes.CSharp.CodeQuality.Linq.UseAnyInsteadOfCount

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