[前][次][番号順一覧][スレッド一覧]

ruby-changes:67413

From: David <ko1@a...>
Date: Tue, 31 Aug 2021 19:06:57 +0900 (JST)
Subject: [ruby-changes:67413] d37c2441cc (master): [rubygems/rubygems] We can now avoid source materialization work

https://git.ruby-lang.org/ruby.git/commit/?id=d37c2441cc

From d37c2441ccd7dcdcedc317065c0f8141f9a66714 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...>
Date: Sat, 24 Jul 2021 18:17:53 +0200
Subject: [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 7d41a2b..4e252b4 100644
--- a/lib/bundler/spec_set.rb
+++ b/lib/bundler/spec_set.rb
@@ -69,16 +69,9 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/spec_set.rb#L69
     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 https://github.com/ruby/ruby/blob/trunk/lib/bundler/spec_set.rb#L81
     # 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<Gem::Specification>]
     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
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]