aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreileencodes <eileencodes@gmail.com>2015-08-21 11:26:19 -0400
committereileencodes <eileencodes@gmail.com>2015-08-21 14:36:51 -0400
commitec9c6d5846a4048c131aae70c2d338d8a3896086 (patch)
treeab3c3856ae3030ce7576a5f244eb6f822378080b
parent34fa6658dd1b779b21e586f01ee64c6f59ca1537 (diff)
downloadrails-ec9c6d5846a4048c131aae70c2d338d8a3896086.tar.gz
rails-ec9c6d5846a4048c131aae70c2d338d8a3896086.tar.bz2
rails-ec9c6d5846a4048c131aae70c2d338d8a3896086.zip
Remove unnecessary caching
`ActiveSupport::Dependencies.constantize(const_name)` calls `Reference.new` which is defined as `ActiveSupport::Dependencies.constantize(const_name)` meaning this call is already cached and we're doing caching that isn't necessary.
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index 20926012b4..c298080ac8 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -1,6 +1,5 @@
require 'action_dispatch/journey'
require 'forwardable'
-require 'thread_safe'
require 'active_support/concern'
require 'active_support/core_ext/object/to_query'
require 'active_support/core_ext/hash/slice'
@@ -23,7 +22,6 @@ module ActionDispatch
class Dispatcher < Routing::Endpoint
def initialize(raise_on_name_error)
@raise_on_name_error = raise_on_name_error
- @controller_class_names = ThreadSafe::Cache.new
end
def dispatcher?; true; end
@@ -61,10 +59,8 @@ module ActionDispatch
protected
- attr_reader :controller_class_names
-
def controller_reference(controller_param)
- const_name = controller_class_names[controller_param] ||= "#{controller_param.camelize}Controller"
+ const_name = "#{controller_param.camelize}Controller"
ActiveSupport::Dependencies.constantize(const_name)
end