search: remove thread-unsafe Hash cache.
Doesn't appear to affect the speed of `brew search`. Fixes #415.
This commit is contained in:
parent
b3ea5c2595
commit
b9efa6336e
@ -126,7 +126,7 @@ module Homebrew
|
|||||||
return []
|
return []
|
||||||
end
|
end
|
||||||
|
|
||||||
@@remote_tap_formulae ||= Hash.new do |cache, key|
|
remote_tap_formulae = Hash.new do |cache, key|
|
||||||
user, repo = key.split("/", 2)
|
user, repo = key.split("/", 2)
|
||||||
tree = {}
|
tree = {}
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ module Homebrew
|
|||||||
cache[key] = paths.map { |path| File.basename(path, ".rb") }
|
cache[key] = paths.map { |path| File.basename(path, ".rb") }
|
||||||
end
|
end
|
||||||
|
|
||||||
names = @@remote_tap_formulae["#{user}/#{repo}"]
|
names = remote_tap_formulae["#{user}/#{repo}"]
|
||||||
user = user.downcase if user == "Homebrew" # special handling for the Homebrew organization
|
user = user.downcase if user == "Homebrew" # special handling for the Homebrew organization
|
||||||
names.select { |name| rx === name }.map { |name| "#{user}/#{repo}/#{name}" }
|
names.select { |name| rx === name }.map { |name| "#{user}/#{repo}/#{name}" }
|
||||||
rescue GitHub::HTTPNotFoundError => e
|
rescue GitHub::HTTPNotFoundError => e
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user