mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[rubygems/rubygems] Set @@all
variable at class definition time
To spare the `defined?` check. https://github.com/rubygems/rubygems/commit/64d27bba01
This commit is contained in:
parent
4acac918f4
commit
fdd3eed037
1 changed files with 2 additions and 1 deletions
|
@ -182,6 +182,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|||
@@default_value[k].nil?
|
||||
end
|
||||
|
||||
@@all = nil
|
||||
@@stubs = nil
|
||||
@@stubs_by_name = {}
|
||||
|
||||
|
@ -748,7 +749,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|||
attr_accessor :specification_version
|
||||
|
||||
def self._all # :nodoc:
|
||||
unless defined?(@@all) && @@all
|
||||
unless @@all
|
||||
@@all = stubs.map(&:to_spec)
|
||||
|
||||
# After a reset, make sure already loaded specs
|
||||
|
|
Loading…
Reference in a new issue