Fix performance regression
This commit is contained in:
parent
78af271069
commit
fe013ce934
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user