mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
PERF: Reduce allocated memory when generating mailing list email.
Before: 10590714 bytes After: 5303394 bytes
This commit is contained in:
parent
8d04afc01b
commit
90cd35c496
@ -228,7 +228,7 @@ module Email
|
|||||||
|
|
||||||
@fragment.css('[href]').each do |element|
|
@fragment.css('[href]').each do |element|
|
||||||
href = element['href']
|
href = element['href']
|
||||||
if href =~ /^\/\/#{host}/
|
if href.start_with?("\/\/#{host}")
|
||||||
element['href'] = "#{scheme}:#{href}"
|
element['href'] = "#{scheme}:#{href}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -260,8 +260,8 @@ module Email
|
|||||||
|
|
||||||
def strip_classes_and_ids
|
def strip_classes_and_ids
|
||||||
@fragment.css('*').each do |element|
|
@fragment.css('*').each do |element|
|
||||||
element.delete('class')
|
element.delete('class'.freeze)
|
||||||
element.delete('id')
|
element.delete('id'.freeze)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user