Skip to content

Commit

Permalink
Update array hash keys to integers (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
CKolkey authored Sep 12, 2024
1 parent 91e441b commit 0bd5b5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/memery.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def define_memoized_method!(klass, method_name, condition: nil, ttl: nil)
end

cache_store = (@_memery_memoized_values ||= {})
cache_key = original_arity.zero? ? method_key : [method_key, *args]
cache_key = original_arity.zero? ? method_key : [method_key, *args].hash
cache = cache_store[cache_key]

return cache.result if cache&.fresh?(ttl)
Expand Down

0 comments on commit 0bd5b5a

Please sign in to comment.