Actions
Patch #34150
closedUse match? instead of =~ when MatchData is not used
Patch #34150:
Use match? instead of =~ when MatchData is not used
Description
String#match? was added in Ruby 2.4. you can replace =~ with faster String#match? or Regexp#match? when MatchData generated by `=~` is not necessary.
The attached patch changes such =~ to mach?. I generated the patch with the following commands.
Files
Actions