-
Notifications
You must be signed in to change notification settings - Fork 0
CAT 039
unurgunite edited this page Jul 11, 2026
·
3 revisions
Severity:
warning• Confidence:high• Auto-fix: ❌
Regex.new in method → constant — Creating a Regex inside a method recompiles on each call. Extract to a constant.
def parse(str)
regex = /pattern/
regex.match(str)
endTip
This rule can significantly improve performance in hot code paths.
Note
See bench results at bench/cat-039/