Skip to content

Commit 0ef05cd

Browse files
committed
Merge pull request rails#25826 from javan/actionview/trim-digestor-template-lookups
Eliminate extra template lookup in ActionView::Digestor
1 parent 9d55183 commit 0ef05cd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

actionview/lib/action_view/digestor.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ def tree(name, finder, partial = false, seen = {})
4242
options = {}
4343
options[:formats] = [finder.rendered_format] if finder.rendered_format
4444

45-
if finder.disable_cache { finder.exists?(logical_name, [], partial, [], options) }
46-
template = finder.disable_cache { finder.find(logical_name, [], partial, [], options) }
45+
if template = finder.disable_cache { finder.find_all(logical_name, [], partial, [], options).first }
4746
finder.rendered_format ||= template.formats.first
4847

4948
if node = seen[template.identifier] # handle cycles in the tree

0 commit comments

Comments
 (0)