Skip to content

Commit

Permalink
Update vendored Molinillo to 0.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
segiddins committed Nov 14, 2016
1 parent 44c2766 commit b2fdac6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
@@ -1,5 +1,5 @@
# frozen_string_literal: true
module Gem::Resolver::Molinillo
# The version of Gem::Resolver::Molinillo.
VERSION = '0.5.3'.freeze
VERSION = '0.5.4'.freeze
end
23 changes: 12 additions & 11 deletions lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb
Expand Up @@ -194,18 +194,20 @@ def unwind_for_conflict
def state_index_for_unwind
current_requirement = requirement
existing_requirement = requirement_for_existing_name(name)
until current_requirement.nil?
current_state = find_state_for(current_requirement)
return states.index(current_state) if state_any?(current_state)
current_requirement = parent_of(current_requirement)
index = -1
[current_requirement, existing_requirement].each do |r|
until r.nil?
current_state = find_state_for(r)
if state_any?(current_state)
current_index = states.index(current_state)
index = current_index if current_index > index
break
end
r = parent_of(r)
end
end

until existing_requirement.nil?
existing_state = find_state_for(existing_requirement)
return states.index(existing_state) if state_any?(existing_state)
existing_requirement = parent_of(existing_requirement)
end
-1
index
end

# @return [Object] the requirement that led to `requirement` being added
Expand Down Expand Up @@ -376,7 +378,6 @@ def fixup_swapped_children(vertex)
activated.delete_edge(outgoing_edge)
requirements.delete(outgoing_edge.requirement)
end
matching_deps.delete(outgoing_edge.requirement)
end
end

Expand Down

0 comments on commit b2fdac6

Please sign in to comment.