Permalink
Browse files

avoid hundreds of thousands of calls to (Symbol|String)#to_s

  • Loading branch information...
1 parent 4da8790 commit 45dad592e47944704ab6951351b2fa29d4a2385f @tenderlove tenderlove committed Nov 30, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 activesupport/lib/active_support/dependencies.rb
@@ -95,7 +95,7 @@ def new_constants
next unless mod.is_a?(Module)
# Get a list of the constants that were added
- new_constants = mod.local_constant_names - original_constants
+ new_constants = mod.local_constants - original_constants
# self[namespace] returns an Array of the constants that are being evaluated
# for that namespace. For instance, if parent.rb requires child.rb, the first
@@ -123,7 +123,7 @@ def watch_namespaces(namespaces)
namespaces.map do |namespace|
module_name = Dependencies.to_constant_name(namespace)
original_constants = Dependencies.qualified_const_defined?(module_name) ?
- Inflector.constantize(module_name).local_constant_names : []
+ Inflector.constantize(module_name).local_constants : []
watching << module_name
self[module_name] << original_constants

0 comments on commit 45dad59

Please sign in to comment.