aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/source
diff options
context:
space:
mode:
authorMartin Emde <martin.emde@gmail.com>2023-08-31 21:38:52 -0700
committergit <svn-admin@ruby-lang.org>2023-09-07 00:33:29 +0000
commit89cb95679dfcb15e404d03959497e5b1dda78df3 (patch)
tree009172754e1945986a7d61718f44b25645370232 /lib/bundler/source
parent86b93f74819dc814a223cd179d15b4d46dc3fc7a (diff)
downloadruby-89cb95679dfcb15e404d03959497e5b1dda78df3.tar.gz
[rubygems/rubygems] Reduce excess index creation and merging
When @allow_cached is true, @allow_local is always true, therefore, the #installed_specs will always be merged after #cached_specs is called. This makes starting with installed_specs.dup redundant. When #cached_specs is called because @allow_remote is true and @allow_cached is false, then installed_specs will be added after cached_specs based on @allow_local. We never need to add installed_specs here, so don't. https://github.com/rubygems/rubygems/commit/49b38f9750
Diffstat (limited to 'lib/bundler/source')
-rw-r--r--lib/bundler/source/rubygems.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index dc82d1d33c..44102c47c8 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -380,7 +380,7 @@ module Bundler
def cached_specs
@cached_specs ||= begin
- idx = @allow_local ? installed_specs.dup : Index.new
+ idx = Index.new
Dir["#{cache_path}/*.gem"].each do |gemfile|
s ||= Bundler.rubygems.spec_from_gem(gemfile)