[ruby/psych] Cache dispatch cache in an instance variable
https://github.com/ruby/psych/commit/285c461cd2
This commit is contained in:
parent
3ab41acd36
commit
155cd7fd2a
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user