diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-08 16:18:37 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-08 16:18:37 -0800 |
commit | c9182597caba4d3cc34fca2c5b883c87bf8b910c (patch) | |
tree | 89f1348a5fa028f22db1d676051a11008aa259ad /actionpack/lib | |
parent | b45a90f9b0c9bed696a85e7ff96abc3aeb1b6252 (diff) | |
download | rails-c9182597caba4d3cc34fca2c5b883c87bf8b910c.tar.gz rails-c9182597caba4d3cc34fca2c5b883c87bf8b910c.tar.bz2 rails-c9182597caba4d3cc34fca2c5b883c87bf8b910c.zip |
reduce string append funcalls
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/template/resolver.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/template/resolver.rb b/actionpack/lib/action_view/template/resolver.rb index 5bf928c62e..4d999fb3b2 100644 --- a/actionpack/lib/action_view/template/resolver.rb +++ b/actionpack/lib/action_view/template/resolver.rb @@ -109,9 +109,9 @@ module ActionView def query(path, exts, formats) query = File.join(@path, path) - exts.each do |ext| - query << '{' << ext.map {|e| e && ".#{e}" }.join(',') << ',}' - end + query << exts.map { |ext| + "{#{ext.compact.map { |e| ".#{e}" }.join(',')},}" + }.join query.gsub!(/\{\.html,/, "{.html,.text.html,") query.gsub!(/\{\.text,/, "{.text,.text.plain,") |