diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2021-11-04 13:12:32 +0100 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2021-11-18 04:37:24 +0900 |
commit | fdd3eed037feabaf2daaa9e1ccec22ad751c5b03 (patch) | |
tree | c8a52389fe1adf7d406dcb1e02771c7b883f8b00 | |
parent | 4acac918f49d6117a857e9acce66bec4648dde81 (diff) |
[rubygems/rubygems] Set `@@all` variable at class definition time
To spare the `defined?` check.
https://github.com/rubygems/rubygems/commit/64d27bba01
-rw-r--r-- | lib/rubygems/specification.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb index d684ff0ced..1c7632fd37 100644 --- a/lib/rubygems/specification.rb +++ b/lib/rubygems/specification.rb @@ -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 |