From c9182597caba4d3cc34fca2c5b883c87bf8b910c Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 8 Feb 2011 16:18:37 -0800 Subject: reduce string append funcalls --- actionpack/lib/action_view/template/resolver.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'actionpack') 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,") -- cgit v1.2.3