mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-12 23:40:45 -07:00
Skip context.evaluate for String lookup keys in VariableLookup — avoids respond_to? dispatch\n\nResult: {"status":"keep","combined_µs":4103,"parse_µs":2881,"render_µs":1222,"allocations":24881}
This commit is contained in:
@@ -170,7 +170,8 @@ module Liquid
|
|||||||
object = context.find_variable(name)
|
object = context.find_variable(name)
|
||||||
|
|
||||||
@lookups.each_index do |i|
|
@lookups.each_index do |i|
|
||||||
key = context.evaluate(@lookups[i])
|
lookup = @lookups[i]
|
||||||
|
key = lookup.instance_of?(String) ? lookup : context.evaluate(lookup)
|
||||||
|
|
||||||
# Cast "key" to its liquid value to enable it to act as a primitive value
|
# Cast "key" to its liquid value to enable it to act as a primitive value
|
||||||
# Fast path: strings and integers (most common key types) don't need conversion
|
# Fast path: strings and integers (most common key types) don't need conversion
|
||||||
|
|||||||
Reference in New Issue
Block a user