Skip to content

CAT 035

unurgunite edited this page Jul 11, 2026 · 3 revisions

CAT-035 — split("") → each_char

Severity: hintConfidence: highAuto-fix:

Description

split("") → each_char — Use each_char instead of split("") to iterate over characters without allocating an array.

Bad code

str.split("").each { |c| ... }

Benchmark

Note

See bench results at bench/cat-035/

Clone this wiki locally