Permalink
Browse files

Use a nested hash to cache index searches

fixes #1486
  • Loading branch information...
1 parent afc2ff6 commit 2671c42c4c7b94bb841cb86c5782652105d547b2 @indirect indirect committed Oct 20, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/bundler/index.rb
View
@@ -130,7 +130,8 @@ def specs_by_name(name)
end
def search_by_dependency(dependency, base = nil)
- @cache[dependency.hash^base.hash] ||= begin
+ @cache[base || false] ||= {}
+ @cache[base || false][dependency] ||= begin
specs = specs_by_name(dependency.name) + (base || [])
found = specs.select do |spec|
if base # allow all platforms when searching from a lockfile

0 comments on commit 2671c42

Please sign in to comment.