Use toSet() instead of toMutableSet().toSet()

Proprietary

toMutableSet() already allocates a fresh set — calling toSet() on it copies again. Go directly to toSet().

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