mirror of
https://github.com/kemko/liquid.git
synced 2026-01-01 15:55:40 +03:00
Merge pull request #932 from Shopify/avoid-default-values-hash
Avoid hash with default values due to inconsistent marshaling
This commit is contained in:
@@ -30,11 +30,11 @@ module Liquid
|
||||
end
|
||||
|
||||
def render(context)
|
||||
context.registers[:cycle] ||= Hash.new(0)
|
||||
context.registers[:cycle] ||= {}
|
||||
|
||||
context.stack do
|
||||
key = context.evaluate(@name)
|
||||
iteration = context.registers[:cycle][key]
|
||||
iteration = context.registers[:cycle][key].to_i
|
||||
result = context.evaluate(@variables[iteration])
|
||||
iteration += 1
|
||||
iteration = 0 if iteration >= @variables.size
|
||||
|
||||
@@ -120,7 +120,7 @@ module Liquid
|
||||
private
|
||||
|
||||
def collection_segment(context)
|
||||
offsets = context.registers[:for] ||= Hash.new(0)
|
||||
offsets = context.registers[:for] ||= {}
|
||||
|
||||
from = if @from == :continue
|
||||
offsets[@name].to_i
|
||||
|
||||
Reference in New Issue
Block a user