Skip to content

CAT 018

unurgunite edited this page Jul 11, 2026 · 3 revisions

CAT-018 — String#downcase == → compare

Field Value
Severity hint
Confidence medium
Auto-fix

String#downcase == → compare — Use case-insensitive comparison instead of downcase + == to avoid allocating a new string.

Bad code

str.downcase == "hello"

Good code

str.compare("hello", case_insensitive: true)

Clone this wiki locally