Use size instead of Collection.count()

Proprietary

Collection.count() without a predicate walks the iterable. size reads the precomputed property on Collection.

org.openrewrite.kotlin.bestpractices.UseSizeForCountNoPredicate$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.bestpractices.UseSizeForCountNoPredicate$KtRecipe'

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