Save some allocations in ActionView digest

This commit is contained in:
Vinicius Stock 2020-09-19 14:03:05 -04:00
parent 3803671a81
commit ecbde46a40
No known key found for this signature in database
GPG Key ID: 2663369A79CCBEC9

@ -17,7 +17,8 @@ def digest(name:, format: nil, finder:, dependencies: nil)
if dependencies.nil? || dependencies.empty?
cache_key = "#{name}.#{format}"
else
cache_key = [ name, format, dependencies ].flatten.compact.join(".")
dependencies_suffix = dependencies.flatten.tap(&:compact!).join(".")
cache_key = "#{name}.#{format}.#{dependencies_suffix}"
end
# this is a correctly done double-checked locking idiom