[前][次][番号順一覧][スレッド一覧]

ruby-changes:69791

From: David <ko1@a...>
Date: Thu, 18 Nov 2021 04:37:46 +0900 (JST)
Subject: [ruby-changes:69791] 81eba77fc0 (master): [rubygems/rubygems] We can now use standard memoization

https://git.ruby-lang.org/ruby.git/commit/?id=81eba77fc0

From 81eba77fc0b2954ebf51a228f7bb94f64dd81f75 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...>
Date: Thu, 4 Nov 2021 13:20:42 +0100
Subject: [rubygems/rubygems] We can now use standard memoization

https://github.com/rubygems/rubygems/commit/231be44d38
---
 lib/rubygems/specification.rb | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
index a4dba9699ec..f6c29b262b5 100644
--- a/lib/rubygems/specification.rb
+++ b/lib/rubygems/specification.rb
@@ -749,10 +749,7 @@ class Gem::Specification < Gem::BasicSpecification https://github.com/ruby/ruby/blob/trunk/lib/rubygems/specification.rb#L749
   attr_accessor :specification_version
 
   def self._all # :nodoc:
-    unless @@all
-      @@all = Gem.loaded_specs.values | stubs.map(&:to_spec)
-    end
-    @@all
+    @@all ||= Gem.loaded_specs.values | stubs.map(&:to_spec)
   end
 
   def self._clear_load_cache # :nodoc:
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]