aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorthedarkone <thedarkone2@gmail.com>2013-08-07 20:13:11 +0200
committerthedarkone <thedarkone2@gmail.com>2013-09-28 19:19:07 +0200
commit2dea0dd099302de640aac28349569c002131c612 (patch)
tree93eda7344bfa9d70412105c7beab959753fe33c6 /actionpack
parentfa915461bc4892b8d53d3d4e202ba16f0dbdfe12 (diff)
downloadrails-2dea0dd099302de640aac28349569c002131c612.tar.gz
rails-2dea0dd099302de640aac28349569c002131c612.tar.bz2
rails-2dea0dd099302de640aac28349569c002131c612.zip
Replace global Hash with TS::Cache.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/journey/visitors.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/journey/visitors.rb b/actionpack/lib/action_dispatch/journey/visitors.rb
index a5b4679fae..9e66cab052 100644
--- a/actionpack/lib/action_dispatch/journey/visitors.rb
+++ b/actionpack/lib/action_dispatch/journey/visitors.rb
@@ -1,9 +1,12 @@
# encoding: utf-8
+
+require 'thread_safe'
+
module ActionDispatch
module Journey # :nodoc:
module Visitors # :nodoc:
class Visitor # :nodoc:
- DISPATCH_CACHE = Hash.new { |h,k|
+ DISPATCH_CACHE = ThreadSafe::Cache.new { |h,k|
h[k] = :"visit_#{k}"
}