mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-15 08:50:45 -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
|
||||
|
||||
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)
|
||||
output
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user