From 2cf4318645f81fb13f6b264369bcfe6fbd4e91b9 Mon Sep 17 00:00:00 2001 From: David Rodríguez Date: Thu, 28 Apr 2022 10:28:31 +0200 Subject: [rubygems/rubygems] Make looping more concise with `select` https://github.com/rubygems/rubygems/commit/c43d5f979a --- lib/bundler/definition.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lib/bundler') diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 8877d2661e..602893c62a 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -680,13 +680,10 @@ module Bundler end def converge_specs(specs) - deps = [] converged = [] - @dependencies.each do |dep| - if specs[dep].any? {|s| s.satisfies?(dep) && (!dep.source || s.source.include?(dep.source)) } - deps << dep - end + deps = @dependencies.select do |dep| + specs[dep].any? {|s| s.satisfies?(dep) && (!dep.source || s.source.include?(dep.source)) } end specs.each do |s| -- cgit v1.2.3