[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
@ -182,6 +182,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|||||||
@@default_value[k].nil?
|
@@default_value[k].nil?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@@all = nil
|
||||||
@@stubs = nil
|
@@stubs = nil
|
||||||
@@stubs_by_name = {}
|
@@stubs_by_name = {}
|
||||||
|
|
||||||
@ -748,7 +749,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|||||||
attr_accessor :specification_version
|
attr_accessor :specification_version
|
||||||
|
|
||||||
def self._all # :nodoc:
|
def self._all # :nodoc:
|
||||||
unless defined?(@@all) && @@all
|
unless @@all
|
||||||
@@all = stubs.map(&:to_spec)
|
@@all = stubs.map(&:to_spec)
|
||||||
|
|
||||||
# After a reset, make sure already loaded specs
|
# After a reset, make sure already loaded specs
|
||||||
|
Loading…
x
Reference in New Issue
Block a user