-
-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Steps to reproduce the problem
puts 'fox'.match(/(f)/) ? $1 : ''
puts $1 if 'cat'.match(/(c)/)
'rabbit'.match(/(r)/)
puts $1
exit unless 'squirrel'.match(/(s)/)
puts $1Expected behavior
MatchData is successfully used in all examples, so should not get patted down by officer.
Actual behavior
4 x [Correctable] Performance/RedundantMatch: Use =~ in places where the MatchData returned by #match will not be used.RuboCop version
ruby 2025-08-01 30a20bc16
rubocop 2025-10-18 f7f653f50
System Version: macOS 15.6 (24G84)
Model Identifier: MacBookAir10,1
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working