Skip to content

Commit

Permalink
Cache dispatch cache in an instance variable
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot committed Jan 30, 2021
1 parent 58223f0 commit 285c461
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/psych/visitors/visitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def self.dispatch_cache

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
Expand Down

0 comments on commit 285c461

Please sign in to comment.