use Ruby Hash as default expression cache

This commit is contained in:
Michael Go
2025-01-10 15:07:57 -04:00
parent 2e236b0a0e
commit a07ae90523
4 changed files with 52 additions and 3 deletions
+6 -2
View File
@@ -16,8 +16,12 @@ module Liquid
# This StringScanner will be shared by all of them
@string_scanner = StringScanner.new("")
@expression_cache = if options[:expression_cache] != false
options[:expression_cache] || LruRedux::Cache.new(10_000)
@expression_cache = if options[:expression_cache].nil?
{}
elsif options[:expression_cache].respond_to?(:[]) && options[:expression_cache].respond_to?(:[]=)
options[:expression_cache]
elsif options[:expression_cache]
{}
end
self.depth = 0