mirror of
https://github.com/ruby/ruby.git
synced 2025-08-24 13:34:17 +02:00
[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.
49b38f9750
This commit is contained in:
parent
86b93f7481
commit
89cb95679d
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue