Skip to content

CAT 023

unurgunite edited this page Jul 11, 2026 · 3 revisions

CAT-023 — includes? on String → char comparison

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

Description

includes? on String → char comparison — Using includes? to check for a single character creates overhead. Use direct comparison or index.

Bad code

str.includes?("a")

Benchmark

Note

See bench results at bench/cat-023/

Clone this wiki locally