summaryrefslogtreecommitdiff
path: root/ext/psych/lib
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2021-01-30 13:43:50 +0100
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-05-10 19:17:32 +0900
commit155cd7fd2a4d5d3a732f73d42385048e16dfbc23 (patch)
treed58c5dc3241d69635aac1eca3f3e769326b6bb0b /ext/psych/lib
parent3ab41acd3617319588a0010657d0adf1caf74d24 (diff)
[ruby/psych] Cache dispatch cache in an instance variable
https://github.com/ruby/psych/commit/285c461cd2
Diffstat (limited to 'ext/psych/lib')
-rw-r--r--ext/psych/lib/psych/visitors/visitor.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/psych/lib/psych/visitors/visitor.rb b/ext/psych/lib/psych/visitors/visitor.rb
index e2585c0c77..21052aa66f 100644
--- a/ext/psych/lib/psych/visitors/visitor.rb
+++ b/ext/psych/lib/psych/visitors/visitor.rb
@@ -17,7 +17,7 @@ module Psych
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