mirror of
https://github.com/discourse/discourse.git
synced 2026-07-31 16:48:26 -05:00
PERF: Memoize EmailReceiver#sent_to_mailinglist_mirror?.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user