Skip to content

CAT 036

unurgunite edited this page Jul 11, 2026 · 3 revisions

CAT-036 — chars.each → each_char

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

Description

chars.each → each_char — Use each_char instead of .chars.each to avoid allocating an intermediate array of characters.

Bad code

str.chars.each { |c| ... }

Benchmark

Note

See bench results at bench/cat-036/

Clone this wiki locally