mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-20 19:30:47 -07:00
fast-path render for filter-less variables: skip render method overhead
This commit is contained in:
@@ -188,7 +188,12 @@ module Liquid
|
|||||||
end
|
end
|
||||||
|
|
||||||
def render_to_output_buffer(context, output)
|
def render_to_output_buffer(context, output)
|
||||||
obj = render(context)
|
# Fast path: no filters and no global filter
|
||||||
|
if @filters.empty? && context.global_filter.nil?
|
||||||
|
obj = context.evaluate(@name)
|
||||||
|
else
|
||||||
|
obj = render(context)
|
||||||
|
end
|
||||||
render_obj_to_output(obj, output)
|
render_obj_to_output(obj, output)
|
||||||
output
|
output
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user