Skip to content

Commit

Permalink
Reave the original comment about Regexp#match 2nd argument
Browse files Browse the repository at this point in the history
  • Loading branch information
r7kamura committed Jul 27, 2022
1 parent d5c692e commit 34b31ab
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/rubocop/cop/performance/redundant_match.rb
Expand Up @@ -56,6 +56,8 @@ def autocorrect(corrector, node)
# @param [RuboCop::AST::SendNode] node
# @return [Boolean]
def autocorrectable?(node)
# Regexp#match can take a second argument, but this cop doesn't
# register an offense in that case
node.receiver.regexp_type? || node.first_argument.regexp_type?
end
end
Expand Down

0 comments on commit 34b31ab

Please sign in to comment.