aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers/cache_helper.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/helpers/cache_helper.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/helpers/cache_helper.rb')
-rw-r--r--actionview/lib/action_view/helpers/cache_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/cache_helper.rb b/actionview/lib/action_view/helpers/cache_helper.rb
index 6b69b71947..020aebeea3 100644
--- a/actionview/lib/action_view/helpers/cache_helper.rb
+++ b/actionview/lib/action_view/helpers/cache_helper.rb
@@ -217,7 +217,7 @@ module ActionView
end
def digest_path_from_template(template) # :nodoc:
- digest = Digestor.digest(name: template.virtual_path, format: template.formats.first, finder: lookup_context, dependencies: view_cache_dependencies)
+ digest = Digestor.digest(name: template.virtual_path, format: template.format, finder: lookup_context, dependencies: view_cache_dependencies)
if digest.present?
"#{template.virtual_path}:#{digest}"