Optimize some regex matching (#15528)

* Use Regex#match?

* Replace =~ too

* Avoid to call match? from Nil

* Keep value of Regexp.last_match
This commit is contained in:
luigi
2021-01-22 04:09:08 -05:00
committed by GitHub
parent 7d0031a515
commit eb51e43fb4
13 changed files with 20 additions and 20 deletions

View File

@@ -72,7 +72,7 @@ class SearchService < BaseService
end
def url_query?
@resolve && @query =~ /\Ahttps?:\/\//
@resolve && /\Ahttps?:\/\//.match?(@query)
end
def url_resource_results