Skip to content

Commit

Permalink
missing: simplify code a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
alyssais committed Oct 25, 2016
1 parent 8e3e8e3 commit c88b67f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Library/Homebrew/diagnostic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand All @@ -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?
Expand Down

0 comments on commit c88b67f

Please sign in to comment.