summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2023-07-12 10:58:27 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-08-16 15:03:38 +0900
commit86492fca653a105d926eb0cad9128e22b324a378 (patch)
treec765fa4bdca231145553a2a4761f654693d9cc6d
parentf1df06294474186137a9d1e80e65cb14ec3a5c66 (diff)
[rubygems/rubygems] Avoid unnecessary loop through dependencies
https://github.com/rubygems/rubygems/commit/2ab63bb94d
-rw-r--r--lib/bundler/definition.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index e043630c2d..397b2da7be 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -805,15 +805,13 @@ module Bundler
def converge_specs(specs)
converged = []
-
- deps = @dependencies.select do |dep|
- specs[dep].any? {|s| s.satisfies?(dep) && (!dep.source || s.source.include?(dep.source)) }
- end
+ deps = []
@specs_that_changed_sources = []
specs.each do |s|
dep = @dependencies.find {|d| s.satisfies?(d) }
+ deps << dep if dep && (!dep.source || s.source.include?(dep.source))
# Replace the locked dependency's source with the equivalent source from the Gemfile
s.source = if dep&.source