Skip to content

Commit cf53a32

Browse files
thedarkonerafaelfranca
authored andcommitted
Replace global Hash with TS::Cache.
Conflicts: actionpack/lib/action_dispatch/journey/visitors.rb
1 parent 0a48cce commit cf53a32

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

actionpack/lib/action_dispatch/journey/visitors.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# encoding: utf-8
2+
3+
require 'thread_safe'
4+
25
module ActionDispatch
36
module Journey # :nodoc:
47
module Visitors # :nodoc:
58
class Visitor # :nodoc:
6-
DISPATCH_CACHE = Hash.new { |h,k|
7-
h[k] = "visit_#{k}"
9+
DISPATCH_CACHE = ThreadSafe::Cache.new { |h,k|
10+
h[k] = :"visit_#{k}"
811
}
912

1013
def accept(node)

0 commit comments

Comments
 (0)