mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-19 02:40:41 -07:00
Changing to keep default_proc support
This commit is contained in:
@@ -164,7 +164,7 @@ module Liquid
|
||||
# This was changed from find() to find_index() because this is a very hot
|
||||
# path and find_index() is optimized in MRI to reduce object allocation
|
||||
scope = (index = @scopes.find_index { |s| s.key?(key) }) && @scopes[index]
|
||||
scope ||= (index = @environments.find_index { |s| s.key?(key) }) && @environments[index]
|
||||
scope ||= (index = @environments.find_index { |s| s.key?(key) || !s.default_proc.nil? }) && @environments[index]
|
||||
scope ||= {}
|
||||
|
||||
variable = lookup_and_evaluate(scope, key, raise_on_not_found: raise_on_not_found).to_liquid
|
||||
|
||||
Reference in New Issue
Block a user