Skip to content

Commit

Permalink
Remove unnecessary caching
Browse files Browse the repository at this point in the history
`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 ec9c6d5
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions actionpack/lib/action_dispatch/routing/route_set.rb
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit ec9c6d5

Please sign in to comment.