Replace map then flatten with flatMap
ProprietaryReplaces .map(f).flatten chains with .flatMap(f) for clarity and to avoid creating an unnecessary intermediate collection.
org. openrewrite. scala. performance. UseFlatMapmod run . --recipe= org. openrewrite. scala. performance. UseFlatMapInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.