提交 0ca6836a 编写于 作者: Ł Łukasz Strzałkowski 提交者: Lukasz Strzalkowski

Don't create addition vars, use options[] directly

上级 f72feae9
...@@ -20,14 +20,9 @@ class << self ...@@ -20,14 +20,9 @@ class << self
def digest(*args) def digest(*args)
options = _setup_options(*args) options = _setup_options(*args)
name = options[:name] details_key = options[:finder].details_key.hash
format = options[:format]
variant = options[:variant]
finder = options[:finder]
details_key = finder.details_key.hash
dependencies = Array.wrap(options[:dependencies]) dependencies = Array.wrap(options[:dependencies])
cache_key = ([name, details_key, format, variant].compact + dependencies).join('.') cache_key = ([options[:name], details_key, options[:format], options[:variant]].compact + dependencies).join('.')
# this is a correctly done double-checked locking idiom # this is a correctly done double-checked locking idiom
# (ThreadSafe::Cache's lookups have volatile semantics) # (ThreadSafe::Cache's lookups have volatile semantics)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册