From eb51e43fb4386120f77f2ff99581f15018a81bd4 Mon Sep 17 00:00:00 2001 From: luigi <007.lva@gmail.com> Date: Fri, 22 Jan 2021 04:09:08 -0500 Subject: Optimize some regex matching (#15528) * Use Regex#match? * Replace =~ too * Avoid to call match? from Nil * Keep value of Regexp.last_match --- lib/mastodon/domains_cli.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') 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 -- cgit