Move start of profiling to a Document#render_to_output_buffer patch

This commit is contained in:
Dylan Thacker-Smith
2020-12-09 10:04:34 -05:00
parent b3f132efd1
commit 896288eff1
3 changed files with 10 additions and 9 deletions
+1 -8
View File
@@ -199,9 +199,7 @@ module Liquid
begin
# render the nodelist.
with_profiling(context) do
@root.render_to_output_buffer(context, output || +'')
end
@root.render_to_output_buffer(context, output || +'')
rescue Liquid::MemoryError => e
context.handle_error(e)
ensure
@@ -224,11 +222,6 @@ module Liquid
Tokenizer.new(source, @line_numbers)
end
def with_profiling(context)
return yield unless context.profiler
context.profiler.profile { yield }
end
def apply_options_to_context(context, options)
context.add_filters(options[:filters]) if options[:filters]
context.global_filter = options[:global_filter] if options[:global_filter]