Use size instead of Collection.count()
ProprietaryCollection.count() without a predicate walks the iterable. size reads the precomputed property on Collection.
org. openrewrite. kotlin. bestpractices. UseSizeForCountNoPredicate$KtRecipemod 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.