requirement: don't merge formula and cask cache in ::expand
This commit is contained in:
parent
cbb788bd17
commit
70d020b6b3
@ -223,7 +223,7 @@ class Requirement
|
||||
def expand(dependent, cache_key: nil, &block)
|
||||
if cache_key.present?
|
||||
cache[cache_key] ||= {}
|
||||
return cache[cache_key][dependent.full_name].dup if cache[cache_key][dependent.full_name]
|
||||
return cache[cache_key][cache_id dependent].dup if cache[cache_key][cache_id dependent]
|
||||
end
|
||||
|
||||
reqs = Requirements.new
|
||||
@ -239,7 +239,7 @@ class Requirement
|
||||
end
|
||||
end
|
||||
|
||||
cache[cache_key][dependent.full_name] = reqs.dup if cache_key.present?
|
||||
cache[cache_key][cache_id dependent] = reqs.dup if cache_key.present?
|
||||
reqs
|
||||
end
|
||||
|
||||
@ -258,5 +258,11 @@ class Requirement
|
||||
def prune
|
||||
throw(:prune, true)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def cache_id(dependent)
|
||||
"#{dependent.full_name}_#{dependent.class}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user