Skip to content

Commit 8cf95f0

Browse files
committed
Prevent unnecessary calls to memory intensive .inner_html. Closes #117
1 parent 1fb39e1 commit 8cf95f0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/odf-report/field.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ def replace!(content, data_item = nil)
1717

1818
txt = content.inner_html
1919

20-
txt.gsub!(to_placeholder, sanitize(@data_source.value))
21-
22-
content.inner_html = txt
20+
if txt.gsub!(to_placeholder, sanitize(@data_source.value))
21+
content.inner_html = txt
22+
end
2323

2424
end
2525

0 commit comments

Comments
 (0)