Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Commit 88cbdd7

Browse files
Apply suggestions from code review
Co-authored-by: Sasha Yelkhovenka <[email protected]>
1 parent 9c2811c commit 88cbdd7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/valid_email2/dns.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def mx_servers_disposable?(domain, domain_list)
3737
mx_server = mx_server.exchange.to_s
3838

3939
domain_list.any? do |disposable_domain|
40-
mx_server.end_with?(disposable_domain) && mx_server =~ /\A(?:.+\.)*?#{disposable_domain}\z/
40+
mx_server.end_with?(disposable_domain) && mx_server.match?(/\A(?:.+\.)*?#{disposable_domain}\z/)
4141
end
4242
end
4343

@@ -89,10 +89,10 @@ def resolv_config
8989
end
9090

9191
def generate_mx_cache_key(domain, domain_list, mx_servers)
92-
return nil if mx_servers.empty? || domain_list.empty?
92+
return if mx_servers.empty? || domain_list.empty?
9393

9494
mx_servers_str = mx_servers.map(&:exchange).map(&:to_s).sort.join
95-
return domain if mx_servers_str == ""
95+
return domain if mx_servers_str.empty?
9696

9797
"#{domain_list.object_id}_#{domain_list.length}_#{mx_servers_str.downcase}"
9898
end

0 commit comments

Comments
 (0)