Use toTypedArray() instead of toList().toTypedArray()
ProprietarytoTypedArray() accepts any Collection; the intermediate toList() just allocates a list that's immediately discarded.
org. openrewrite. kotlin. bestpractices. UseToTypedArrayForToListThenToTypedArray$KtRecipemod run . --recipe= 'org. openrewrite. kotlin. bestpractices. UseToTypedArrayForToListThenToTypedArray$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.