mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
reduce string append funcalls
This commit is contained in:
@@ -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,")
|
||||
|
||||
Reference in New Issue
Block a user