-
Notifications
You must be signed in to change notification settings - Fork 0
CAT 033
unurgunite edited this page Jul 11, 2026
·
3 revisions
Severity:
warning• Confidence:medium• Auto-fix: ❌
select.map → single-pass — Chaining select + map creates two intermediate arrays. Combine into a single pass.
ary.select { |x| x > 0 }.map { |x| x * 2 }Tip
This rule can significantly improve performance in hot code paths.
Note
See bench results at bench/cat-033/