Fix Performance/MapCompact offenses for most lib/
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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Peter Leitzen