diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 0031811c5851f..a5b1302bdee01 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -8,6 +8,8 @@ module Homebrew module Diagnostic def self.missing_deps(ff, hide = nil) + hide ||= [] + missing = {} ff.each do |f| missing_deps = f.recursive_dependencies do |dependent, dep| @@ -20,12 +22,8 @@ def self.missing_deps(ff, hide = nil) end missing_deps.map!(&:to_formula) - if hide - missing_deps.reject! do |d| - !hide.include?(d.name) && d.installed_prefixes.any? - end - else - missing_deps.reject! { |d| d.installed_prefixes.any? } + missing_deps.reject! do |d| + !hide.include?(d.name) && d.installed_prefixes.any? end unless missing_deps.empty?