Skip to content

Fix Performance/MapCompact offenses for most lib/

Peter Leitzen requested to merge pl-rubocop-fix-map-compact-1 into master

What does this MR do and why?

Part 1 of fixing 👮 Performance/MapCompact offenses for lib/ and its specs.

Done via bundle exec rubocop -A --only Performance/MapCompact.

Note that autocorrection is unsafe so through review is required.

For example, the following examples are not equivalent:

[true, false, nil].map(&:itself).compact # => [true, false]

[true, false, nil].filter_map(&:itself) # => [true]

How to set up and validate locally

Run

bundle exec rubocop --only Performance/MapCompact --parallel
# No offense

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Peter Leitzen

Merge request reports