-
Notifications
You must be signed in to change notification settings - Fork 0
CAT 002
unurgunite edited this page Jul 11, 2026
·
3 revisions
Severity:
warning• Confidence:high• Auto-fix: ✅
Tip
This rule supports auto-fix via --fix
map{}.sum → sum{} — Use sum with a block instead of map + sum to avoid creating an intermediate array.
ary.map { |x| x * 2 }.sumary.sum { |x| x * 2 }Tip
This rule can significantly improve performance in hot code paths.
Note
See bench results at bench/cat-002/