aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/renderer/template_renderer.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2019-02-25 13:18:44 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2019-02-25 13:18:44 -0800
commitca5e23ed4d8818d81314953aadd422b2cbde63b0 (patch)
treea411836c47d0ac22af072ec580656e983954d131 /actionview/lib/action_view/renderer/template_renderer.rb
parentd1f68b50487ea1a8fc7f822973e2cc46d1288060 (diff)
downloadrails-ca5e23ed4d8818d81314953aadd422b2cbde63b0.tar.gz
rails-ca5e23ed4d8818d81314953aadd422b2cbde63b0.tar.bz2
rails-ca5e23ed4d8818d81314953aadd422b2cbde63b0.zip
Templates have one format
Templates only have one format. Before this commit, templates would be constructed with a single element array that contained the format. This commit eliminates the single element array and just implements a `format` method. This saves one array allocation per template.
Diffstat (limited to 'actionview/lib/action_view/renderer/template_renderer.rb')
-rw-r--r--actionview/lib/action_view/renderer/template_renderer.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionview/lib/action_view/renderer/template_renderer.rb b/actionview/lib/action_view/renderer/template_renderer.rb
index 87f6cf3de3..83b990b081 100644
--- a/actionview/lib/action_view/renderer/template_renderer.rb
+++ b/actionview/lib/action_view/renderer/template_renderer.rb
@@ -8,7 +8,7 @@ module ActionView
@details = extract_details(options)
template = determine_template(options)
- prepend_formats(template.formats)
+ prepend_formats(template.format)
render_template(context, template, options[:layout], options[:locals] || {})
end