ruby-changes:66125
From: Jean <ko1@a...>
Date: Mon, 10 May 2021 19:20:01 +0900 (JST)
Subject: [ruby-changes:66125] 155cd7fd2a (master): [ruby/psych] Cache dispatch cache in an instance variable
https://git.ruby-lang.org/ruby.git/commit/?id=155cd7fd2a From 155cd7fd2a4d5d3a732f73d42385048e16dfbc23 Mon Sep 17 00:00:00 2001 From: Jean Boussier <jean.boussier@g...> Date: Sat, 30 Jan 2021 13:43:50 +0100 Subject: [ruby/psych] Cache dispatch cache in an instance variable https://github.com/ruby/psych/commit/285c461cd2 --- ext/psych/lib/psych/visitors/visitor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/psych/lib/psych/visitors/visitor.rb b/ext/psych/lib/psych/visitors/visitor.rb index e2585c0..21052aa 100644 --- a/ext/psych/lib/psych/visitors/visitor.rb +++ b/ext/psych/lib/psych/visitors/visitor.rb @@ -17,7 +17,7 @@ module Psych https://github.com/ruby/ruby/blob/trunk/ext/psych/lib/psych/visitors/visitor.rb#L17 if defined?(Ractor) def dispatch - Ractor.current[:Psych_Visitors_Visitor] ||= Visitor.dispatch_cache + @dispatch_cache ||= (Ractor.current[:Psych_Visitors_Visitor] ||= Visitor.dispatch_cache) end else DISPATCH = dispatch_cache -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/