=~
in places where the MatchData
returned by #match
will not be used RB-PR1016The return value of =~
is an integral index/nil
and is more performant.
do_something if str.match(/regex/)
while regex.match('str')
do_something
end
method(str =~ /regex/)
return value unless regex =~ 'str'