reduce string append funcalls

This commit is contained in:
Aaron Patterson
2011-02-08 16:18:37 -08:00
parent b45a90f9b0
commit c9182597ca

View File

@@ -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,")