Skip to content

CAT 007

unurgunite edited this page Jul 11, 2026 · 3 revisions

CAT-007 — reverse.each → reverse_each

Field Value
Severity hint
Confidence high
Auto-fix

reverse.each → reverse_each — Use reverse_each instead of reverse + each to avoid allocating a reversed copy.

Bad code

ary.reverse.each { |x| ... }

Good code

ary.reverse_each { |x| ... }

Clone this wiki locally