Merge pull request #25826 from javan/actionview/trim-digestor-template-lookups

Eliminate extra template lookup in ActionView::Digestor
This commit is contained in:
Rafael França 2016-07-15 16:29:17 -03:00 committed by GitHub
commit d41d7a4214

@ -41,8 +41,7 @@ def tree(name, finder, partial = false, seen = {})
options = {} options = {}
options[:formats] = [finder.rendered_format] if finder.rendered_format options[:formats] = [finder.rendered_format] if finder.rendered_format
if finder.disable_cache { finder.exists?(logical_name, [], partial, [], options) } if template = finder.disable_cache { finder.find_all(logical_name, [], partial, [], options).first }
template = finder.disable_cache { finder.find(logical_name, [], partial, [], options) }
finder.rendered_format ||= template.formats.first finder.rendered_format ||= template.formats.first
if node = seen[template.identifier] # handle cycles in the tree if node = seen[template.identifier] # handle cycles in the tree