Find Pattern.compile calls inside collection lambdas

Proprietary

Pattern.compile(...) parses the pattern up front; running it inside a map/filter/forEach lambda recompiles the pattern for every element. Hoist the Pattern to a top-level property.

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