Skip to content

CAT 003

unurgunite edited this page Jul 11, 2026 · 3 revisions

CAT-003 — select + reject → partition

Severity: infoConfidence: highAuto-fix:

Description

select + reject → partition — Use partition instead of two separate select/reject calls to iterate once.

Bad code

ary.select { |x| x > 0 }
ary.reject { |x| x > 0 }

Benchmark

Note

See bench results at bench/cat-003/

Clone this wiki locally