aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorrichiethomas2017-10-20 09:36:27 -0400
committerrichiethomas2017-10-20 09:42:30 -0400
commit43cbf08018c6ed8f3bc2142c368ba7b7c9fcf49e (patch)
tree9e3f884da127b5c9c0a660373a241fc457117b3a /Library/Homebrew
parentb135a70c57b059bd42fb2095a7f29e73ce5d6aad (diff)
downloadbrew-43cbf08018c6ed8f3bc2142c368ba7b7c9fcf49e.tar.bz2
Remove memoization from uses.rb, as it doesn't result in the expected time complexity savings
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/cmd/readall.rb2
-rw-r--r--Library/Homebrew/cmd/uses.rb4
2 files changed, 1 insertions, 5 deletions
diff --git a/Library/Homebrew/cmd/readall.rb b/Library/Homebrew/cmd/readall.rb
index b54405d30..f870d3a4e 100644
--- a/Library/Homebrew/cmd/readall.rb
+++ b/Library/Homebrew/cmd/readall.rb
@@ -14,7 +14,7 @@ module Homebrew
def readall
if ARGV.include?("--syntax")
scan_files = "#{HOMEBREW_LIBRARY_PATH}/**/*.rb"
- ruby_files = Dir.glob(scan_files).reject { |file| file =~ /vendor|cask/ }
+ ruby_files = Dir.glob(scan_files).reject { |file| file =~ %r{/(vendor|cask)/} }
Homebrew.failed = true unless Readall.valid_ruby_syntax?(ruby_files)
end
diff --git a/Library/Homebrew/cmd/uses.rb b/Library/Homebrew/cmd/uses.rb
index 5b6319cdc..0b09e1bf1 100644
--- a/Library/Homebrew/cmd/uses.rb
+++ b/Library/Homebrew/cmd/uses.rb
@@ -54,14 +54,11 @@ 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?
@@ -75,7 +72,6 @@ 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|