diff options
author | luigi <007.lva@gmail.com> | 2021-01-22 04:09:08 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-22 10:09:08 +0100 |
commit | eb51e43fb4386120f77f2ff99581f15018a81bd4 (patch) | |
tree | ac52a3d084a3eafc1a1943be8ab2393465abc1ec /lib/mastodon/domains_cli.rb | |
parent | 7d0031a515a9ccd552fab9ad55b6edb7e0e5ba32 (diff) |
Optimize some regex matching (#15528)
* Use Regex#match? * Replace =~ too * Avoid to call match? from Nil * Keep value of Regexp.last_match
Diffstat (limited to 'lib/mastodon/domains_cli.rb')
-rw-r--r-- | lib/mastodon/domains_cli.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/mastodon/domains_cli.rb b/lib/mastodon/domains_cli.rb index 3c2dfd4ec..4ebd8a1e2 100644 --- a/lib/mastodon/domains_cli.rb +++ b/lib/mastodon/domains_cli.rb @@ -93,7 +93,7 @@ module Mastodon work_unit = ->(domain) do next if stats.key?(domain) - next if options[:exclude_suspended] && domain.match(blocked_domains) + next if options[:exclude_suspended] && domain.match?(blocked_domains) stats[domain] = nil |