Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions bundler/lib/bundler/spec_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ def initialize(specs)
end

def for(dependencies, check = false, match_current_platform = false)
handled = []
# dep.name => [list, of, deps]
handled = Hash.new {|h, k| h[k] = [] }
deps = dependencies.dup
specs = []

loop do
break unless dep = deps.shift
next if handled.any? {|d| d.name == dep.name && (match_current_platform || d.__platform == dep.__platform) } || dep.name == "bundler"
next if handled[dep.name].any? {|d| match_current_platform || d.__platform == dep.__platform } || dep.name == "bundler"

handled << dep
# use a hash here to ensure constant lookup time in the `any?` call above
handled[dep.name] << dep

specs_for_dep = spec_for_dependency(dep, match_current_platform)
if specs_for_dep.any?
Expand Down