Permalink
Browse files

reduce string append funcalls

  • Loading branch information...
1 parent b45a90f commit c9182597caba4d3cc34fca2c5b883c87bf8b910c @tenderlove tenderlove committed Feb 9, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 actionpack/lib/action_view/template/resolver.rb
@@ -109,9 +109,9 @@ def find_templates(name, prefix, partial, details)
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,")

0 comments on commit c918259

Please sign in to comment.