fix expression cache to be compatible with Ruby Hash and LruCache

This commit is contained in:
Michael Go 2025-01-10 14:58:23 -04:00
parent bd05dfbd1c
commit 2e236b0a0e

View File

@ -44,7 +44,9 @@ module Liquid
# Cache only exists during parsing
if cache
cache.getset(markup) { inner_parse(markup, ss, cache).freeze }
return cache[markup] if cache.key?(markup)
cache[markup] = inner_parse(markup, ss, cache).freeze
else
inner_parse(markup, ss, nil).freeze
end