PERF: Memoize `EmailReceiver#sent_to_mailinglist_mirror?`.
This commit is contained in:
parent
6acba44ed9
commit
791ddb8630
|
@ -527,14 +527,16 @@ module Email
|
|||
end
|
||||
|
||||
def sent_to_mailinglist_mirror?
|
||||
destinations.each do |destination|
|
||||
next unless destination[:type] == :category
|
||||
@sent_to_mailinglist_mirror ||= begin
|
||||
destinations.each do |destination|
|
||||
next unless destination[:type] == :category
|
||||
|
||||
category = destination[:obj]
|
||||
return true if category.mailinglist_mirror?
|
||||
category = destination[:obj]
|
||||
return true if category.mailinglist_mirror?
|
||||
end
|
||||
|
||||
false
|
||||
end
|
||||
|
||||
false
|
||||
end
|
||||
|
||||
def self.check_address(address)
|
||||
|
|
Loading…
Reference in New Issue