mirror of
https://github.com/kemko/liquid.git
synced 2026-01-01 15:55:40 +03:00
Use Array#each instead of Array#inject to avoid an object allocation (#1341)
This commit is contained in:
committed by
GitHub
parent
a3ff300419
commit
8f7f8761d1
@@ -83,9 +83,11 @@ module Liquid
|
||||
end
|
||||
|
||||
def render(context)
|
||||
obj = @filters.inject(context.evaluate(@name)) do |output, (filter_name, filter_args, filter_kwargs)|
|
||||
obj = context.evaluate(@name)
|
||||
|
||||
@filters.each do |filter_name, filter_args, filter_kwargs|
|
||||
filter_args = evaluate_filter_expressions(context, filter_args, filter_kwargs)
|
||||
context.invoke(filter_name, output, *filter_args)
|
||||
obj = context.invoke(filter_name, obj, *filter_args)
|
||||
end
|
||||
|
||||
context.apply_global_filter(obj)
|
||||
|
||||
Reference in New Issue
Block a user