Fix performance regression from introduction of Template#disable_tags (#1274)

This commit is contained in:
Dylan Thacker-Smith
2020-08-18 11:25:51 -04:00
committed by GitHub
parent a1d982ca76
commit 2b11efc3ae
16 changed files with 164 additions and 199 deletions
+1 -12
View File
@@ -171,13 +171,7 @@ module Liquid
private
def render_node(context, output, node)
if node.disabled?(context)
output << node.disabled_error_message
return
end
disable_tags(context, node.disabled_tags) do
node.render_to_output_buffer(context, output)
end
node.render_to_output_buffer(context, output)
rescue UndefinedVariable, UndefinedDropMethod, UndefinedFilter => e
context.handle_error(e, node.line_number)
rescue ::StandardError => e
@@ -185,11 +179,6 @@ module Liquid
output << context.handle_error(e, line_number)
end
def disable_tags(context, tags, &block)
return yield if tags.empty?
context.registers[:disabled_tags].disable(tags, &block)
end
def raise_if_resource_limits_reached(context, length)
context.resource_limits.render_length += length
return unless context.resource_limits.reached?