Fix haml-lint MultilineScript offense
A false positive is triggered by the linter MultilineScript, so this explains the switch from =~ to match?. On top of this, since Ruby 2.4, `String#match?`, `Regexp#match?` and `Symbol#match?` have been added. The methods are faster than `match`/`=~`. Because the methods avoid creating a `MatchData` object or saving backref. So, when `MatchData` is not used, use `match?` instead of `match`/`=~`.
parent
646b53d5
Please register or sign in to comment