[ruby/psych] Cache dispatch cache in an instance variable

https://github.com/ruby/psych/commit/285c461cd2
This commit is contained in:
Jean Boussier 2021-01-30 13:43:50 +01:00 committed by Hiroshi SHIBATA
parent 3ab41acd36
commit 155cd7fd2a
No known key found for this signature in database
GPG Key ID: F9CF13417264FAC2

View File

@ -17,7 +17,7 @@ module Psych
if defined?(Ractor) if defined?(Ractor)
def dispatch def dispatch
Ractor.current[:Psych_Visitors_Visitor] ||= Visitor.dispatch_cache @dispatch_cache ||= (Ractor.current[:Psych_Visitors_Visitor] ||= Visitor.dispatch_cache)
end end
else else
DISPATCH = dispatch_cache DISPATCH = dispatch_cache