From 155cd7fd2a4d5d3a732f73d42385048e16dfbc23 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Sat, 30 Jan 2021 13:43:50 +0100 Subject: [PATCH] [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 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