lib/bundler/definition.rb in bundler-1.6.2 vs lib/bundler/definition.rb in bundler-1.6.3
- old
+ new
@@ -410,14 +410,12 @@
# the source should be found.
def specs_changed?(source, &block)
locked = @locked_sources.find(&block)
if locked
- unlocking = locked.specs.any? do |spec|
- @locked_specs.any? do |locked_spec|
- locked_spec.source != locked
- end
+ unlocking = @locked_specs.any? do |locked_spec|
+ locked_spec.source != locked
end
end
!locked || unlocking || source.specs != locked.specs
end
@@ -506,11 +504,12 @@
# Build a list of dependencies that are the same in the Gemfile
# and Gemfile.lock. If the Gemfile modified a dependency, but
# the gem in the Gemfile.lock still satisfies it, this is fine
# too.
+ locked_deps_hash = @locked_deps.inject({}) { |hsh, dep| hsh[dep] = dep; hsh }
@dependencies.each do |dep|
- locked_dep = @locked_deps.find { |d| dep == d }
+ locked_dep = locked_deps_hash[dep]
if in_locked_deps?(dep, locked_dep) || satisfies_locked_spec?(dep)
deps << dep
elsif dep.source.is_a?(Source::Path) && dep.current_platform? && (!locked_dep || dep.source != locked_dep.source)
@locked_specs.each do |s|