Find BigDecimal("...") allocations inside loops
ProprietaryParsing a BigDecimal from a String literal inside a loop reparses the same value every iteration. Hoist the literal BigDecimal out of the loop or use a cached constant.
org. openrewrite. kotlin. performance. FindBigDecimalFromStringInLoops$KtRecipemod run . --recipe= 'org. openrewrite. kotlin. performance. FindBigDecimalFromStringInLoops$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.