Use stdlib accessors for size / first

Proprietary

Replaces walk-based accessors with their O(1) property/method equivalents — count()/length/size and get(0)/first().

org.openrewrite.kotlin.bestpractices.UseStdlibAccessors$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.bestpractices.UseStdlibAccessors$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.

Recipe list

It runs these recipes, in this order.

  1. Use length instead of String.count()
  2. Use size instead of Collection.count()
  3. Use first() instead of get(0)