diff options
| -rw-r--r-- | Library/Homebrew/cmd/uses.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/uses.rb b/Library/Homebrew/cmd/uses.rb index 0b09e1bf1..5b6319cdc 100644 --- a/Library/Homebrew/cmd/uses.rb +++ b/Library/Homebrew/cmd/uses.rb @@ -54,11 +54,14 @@ module Homebrew end ignores << "recommended?" if ARGV.include? "--skip-recommended" + memo = {} uses = formulae.select do |f| used_formulae.all? do |ff| begin if recursive deps = f.recursive_dependencies do |dependent, dep| + memo_key = [dependent, dep].to_s + next if memo[memo_key] if dep.recommended? Dependency.prune if ignores.include?("recommended?") || dependent.build.without?(dep) elsif dep.optional? @@ -72,6 +75,7 @@ module Homebrew if dep.is_a?(TapDependency) && !dep.tap.installed? Dependency.keep_but_prune_recursive_deps end + memo[memo_key] = true end dep_formulae = deps.flat_map do |dep| |
