From d37c2441ccd7dcdcedc317065c0f8141f9a66714 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Sat, 24 Jul 2021 18:17:53 +0200 Subject: [PATCH] [rubygems/rubygems] We can now avoid source materialization work No need to fill up missing names from sources anymore since they should now be properly set up correctly from the beginning. https://github.com/rubygems/rubygems/commit/706fd28681 --- lib/bundler/spec_set.rb | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/lib/bundler/spec_set.rb b/lib/bundler/spec_set.rb index 7d41a2bc92..4e252b45a7 100644 --- a/lib/bundler/spec_set.rb +++ b/lib/bundler/spec_set.rb @@ -69,16 +69,9 @@ module Bundler def materialize(deps) materialized = self.for(deps, false, true) - materialized.group_by(&:source).each do |source, specs| - next unless specs.any?{|s| s.is_a?(LazySpecification) } - - source.local! - names = -> { specs.map(&:name).uniq } - source.double_check_for(names) - end - materialized.map! do |s| next s unless s.is_a?(LazySpecification) + s.source.local! s.__materialize__ || s end SpecSet.new(materialized) @@ -88,17 +81,10 @@ module Bundler # This is in contrast to how for does platform filtering (and specifically different from how `materialize` calls `for` only for the current platform) # @return [Array] def materialized_for_all_platforms - @specs.group_by(&:source).each do |source, specs| - next unless specs.any?{|s| s.is_a?(LazySpecification) } - - source.local! - source.remote! - names = -> { specs.map(&:name).uniq } - source.double_check_for(names) - end - @specs.map do |s| next s unless s.is_a?(LazySpecification) + s.source.local! + s.source.remote! spec = s.__materialize__ raise GemNotFound, "Could not find #{s.full_name} in any of the sources" unless spec spec