-
Notifications
You must be signed in to change notification settings - Fork 0
CAT 008
unurgunite edited this page Jul 11, 2026
·
3 revisions
Severity:
warning• Confidence:high• Auto-fix: ✅
Tip
This rule supports auto-fix via --fix
select.first/last → find — Use find instead of select + first/last to stop early after finding the match.
ary.select { |x| x > 0 }.first
ary.select { |x| x > 0 }.lastary.find { |x| x > 0 }Tip
This rule can significantly improve performance in hot code paths.
Note
See bench results at bench/cat-008/