Permalink
Browse files

Fix performance regression

  • Loading branch information...
1 parent 78af271 commit fe013ce93415a88b6c23fd750bd8cbab60d6395d @jeremy jeremy committed Jan 17, 2009
Showing with 6 additions and 2 deletions.
  1. +1 −1 actionpack/lib/action_view/template.rb
  2. +5 −1 actionpack/lib/action_view/template_handlers.rb
@@ -204,7 +204,7 @@ def load!
private
def valid_extension?(extension)
- Template.template_handler_extensions.include?(extension)
+ !Template.registered_template_handler(extension).nil?
end
def find_full_path(path, load_paths)
@@ -32,13 +32,17 @@ def template_handler_extensions
@@template_handlers.keys.map(&:to_s).sort
end
+ def registered_template_handler(extension)
+ extension && @@template_handlers[extension.to_sym]
+ end
+
def register_default_template_handler(extension, klass)
register_template_handler(extension, klass)
@@default_template_handlers = klass
end
def handler_class_for_extension(extension)
- (extension && @@template_handlers[extension.to_sym]) || @@default_template_handlers
+ registered_template_handler(extension) || @@default_template_handlers
end
end
end

0 comments on commit fe013ce

Please sign in to comment.