Skip to content

CAT 031

unurgunite edited this page Jul 11, 2026 · 3 revisions

CAT-031 — values.includes? → has_value?

Severity: infoConfidence: highAuto-fix:

Description

values.includes? → has_value? — Use has_value? instead of .values.includes? to check value existence without allocating an array.

Bad code

hash.values.includes?("target")

Benchmark

Note

See bench results at bench/cat-031/

Clone this wiki locally