mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-29 07:05:12 -07:00
Remove needless intermediate local var in VariableLookup#initialize
This commit is contained in:
@@ -10,21 +10,20 @@ module Liquid
|
|||||||
end
|
end
|
||||||
|
|
||||||
def initialize(markup)
|
def initialize(markup)
|
||||||
lookups = markup.scan(VariableParser)
|
@lookups = markup.scan(VariableParser)
|
||||||
|
|
||||||
name = lookups.shift
|
name = @lookups.shift
|
||||||
if name =~ SQUARE_BRACKETED
|
if name =~ SQUARE_BRACKETED
|
||||||
name = Expression.parse($1)
|
name = Expression.parse($1)
|
||||||
end
|
end
|
||||||
@name = name
|
@name = name
|
||||||
|
|
||||||
@lookups = lookups
|
|
||||||
@command_flags = 0
|
@command_flags = 0
|
||||||
|
|
||||||
@lookups.each_index do |i|
|
@lookups.each_index do |i|
|
||||||
lookup = lookups[i]
|
lookup = @lookups[i]
|
||||||
if lookup =~ SQUARE_BRACKETED
|
if lookup =~ SQUARE_BRACKETED
|
||||||
lookups[i] = Expression.parse($1)
|
@lookups[i] = Expression.parse($1)
|
||||||
elsif COMMAND_METHODS.include?(lookup)
|
elsif COMMAND_METHODS.include?(lookup)
|
||||||
@command_flags |= 1 << i
|
@command_flags |= 1 << i
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user