Use length instead of String.count()
ProprietaryString.count() walks every character and increments a counter. length reads the precomputed size off the String header.
org. openrewrite. kotlin. bestpractices. UseLengthForCountNoPredicate$KtRecipemod run . --recipe= 'org. openrewrite. kotlin. bestpractices. UseLengthForCountNoPredicate$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.