Skip to content

Commit

Permalink
use lru_redux getset for simplicity
Browse files Browse the repository at this point in the history
  • Loading branch information
ggmichaelgo committed Jan 10, 2025
1 parent 2a5ecf0 commit bd05dfb
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/liquid/expression.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ def parse(markup, ss = StringScanner.new(""), cache = nil)

# Cache only exists during parsing
if cache
return cache[markup] if cache.key?(markup)

cache[markup] = inner_parse(markup, ss, cache).freeze
cache.getset(markup) { inner_parse(markup, ss, cache).freeze }
else
inner_parse(markup, ss, nil).freeze
end
Expand Down

0 comments on commit bd05dfb

Please sign in to comment.