Merge loops

This commit is contained in:
Peter Zhu
2020-10-27 10:42:30 -04:00
parent 5c082472a1
commit 292d971937
2 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -21,10 +21,10 @@ module Liquid
def parse(tokens) def parse(tokens)
body = new_body body = new_body
body = @blocks.last.attachment while parse_body(body, tokens) body = @blocks.last.attachment while parse_body(body, tokens)
if blank? @blocks.each do |condition|
@blocks.each { |condition| condition.attachment.remove_blank_strings } condition.attachment.remove_blank_strings if blank?
condition.attachment.freeze
end end
@blocks.each { |condition| condition.attachment.freeze }
end end
def nodelist def nodelist
+3 -3
View File
@@ -31,10 +31,10 @@ module Liquid
def parse(tokens) def parse(tokens)
while parse_body(@blocks.last.attachment, tokens) while parse_body(@blocks.last.attachment, tokens)
end end
if blank? @blocks.each do |block|
@blocks.each { |condition| condition.attachment.remove_blank_strings } block.attachment.remove_blank_strings if blank?
block.attachment.freeze
end end
@blocks.each { |block| block.attachment.freeze }
end end
def unknown_tag(tag, markup, tokens) def unknown_tag(tag, markup, tokens)