Permalink
Browse files

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.
  • Loading branch information...
eileencodes committed Aug 21, 2015
1 parent 34fa665 commit ec9c6d5846a4048c131aae70c2d338d8a3896086
Showing with 1 addition and 5 deletions.
  1. +1 −5 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 @@ class RouteSet
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 @@ def controller(params, raise_on_name_error=true)
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

0 comments on commit ec9c6d5

Please sign in to comment.