Use toList() instead of toMutableList().toList()
ProprietarytoMutableList() allocates a mutable copy, then toList() copies it again to an immutable list. toList() directly does what's needed in one pass.
org. openrewrite. kotlin. bestpractices. UseToListForToMutableListThenToList$KtRecipemod run . --recipe= 'org. openrewrite. kotlin. bestpractices. UseToListForToMutableListThenToList$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.