Use toSet() instead of toList().toSet()
ProprietarytoSet() works on any Iterable. The intermediate toList() just allocates a list that's immediately discarded.
org. openrewrite. kotlin. bestpractices. UseToSetForToListThenToSet$KtRecipemod run . --recipe= 'org. openrewrite. kotlin. bestpractices. UseToSetForToListThenToSet$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.