Skip to content

CAT 021

unurgunite edited this page Jul 11, 2026 · 3 revisions

CAT-021 — values.each → each_value

Severity: info | Confidence: high | Auto-fix:

Description

values.each → each_value — Use each_value instead of .values.each to avoid allocating an intermediate array.

Bad code

hash.values.each { |v| ... }

Benchmark

Note

See bench results at bench/cat-021/

Clone this wiki locally