diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2019-02-25 13:18:44 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2019-02-25 13:18:44 -0800 |
commit | ca5e23ed4d8818d81314953aadd422b2cbde63b0 (patch) | |
tree | a411836c47d0ac22af072ec580656e983954d131 /actionview/lib/action_view/file_template.rb | |
parent | d1f68b50487ea1a8fc7f822973e2cc46d1288060 (diff) | |
download | rails-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/file_template.rb')
-rw-r--r-- | actionview/lib/action_view/file_template.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionview/lib/action_view/file_template.rb b/actionview/lib/action_view/file_template.rb index 4921074383..43206f02e5 100644 --- a/actionview/lib/action_view/file_template.rb +++ b/actionview/lib/action_view/file_template.rb @@ -22,11 +22,11 @@ module ActionView # to ensure that references to the template object can be marshalled as well. This means forgoing # the marshalling of the compiler mutex and instantiating that again on unmarshalling. def marshal_dump # :nodoc: - [ @identifier, @handler, @compiled, @original_encoding, @locals, @virtual_path, @updated_at, @formats, @variants ] + [ @identifier, @handler, @compiled, @original_encoding, @locals, @virtual_path, @updated_at, @format, @variants ] end def marshal_load(array) # :nodoc: - @identifier, @handler, @compiled, @original_encoding, @locals, @virtual_path, @updated_at, @formats, @variants = *array + @identifier, @handler, @compiled, @original_encoding, @locals, @virtual_path, @updated_at, @format, @variants = *array @compile_mutex = Mutex.new end end |