Skip to content
Snippets Groups Projects
Commit b9efa633 authored by Mike McQuaid's avatar Mike McQuaid
Browse files

search: remove thread-unsafe Hash cache.

Doesn't appear to affect the speed of `brew search`.

Fixes #415.
parent b3ea5c25
No related branches found
No related tags found
No related merge requests found
......@@ -126,7 +126,7 @@ module Homebrew
return []
end
@@remote_tap_formulae ||= Hash.new do |cache, key|
remote_tap_formulae = Hash.new do |cache, key|
user, repo = key.split("/", 2)
tree = {}
......@@ -148,7 +148,7 @@ module Homebrew
cache[key] = paths.map { |path| File.basename(path, ".rb") }
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
names.select { |name| rx === name }.map { |name| "#{user}/#{repo}/#{name}" }
rescue GitHub::HTTPNotFoundError => e
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment