mirror of
https://github.com/discourse/discourse.git
synced 2025-03-06 03:09:43 +00:00
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…
x
Reference in New Issue
Block a user