From 37b77c6ae7effdba51ecd8b3b91e2cdb0020b6aa Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 8 Aug 2011 22:16:52 -0700 Subject: refactor the optimized build_query a bit --- actionpack/lib/action_view/template/resolver.rb | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'actionpack/lib/action_view/template/resolver.rb') diff --git a/actionpack/lib/action_view/template/resolver.rb b/actionpack/lib/action_view/template/resolver.rb index c66990e1ca..d0b5c76f1a 100644 --- a/actionpack/lib/action_view/template/resolver.rb +++ b/actionpack/lib/action_view/template/resolver.rb @@ -237,15 +237,10 @@ module ActionView class OptimizedFileSystemResolver < FileSystemResolver #:nodoc: def build_query(path, details) exts = EXTENSIONS.map { |ext| details[ext] } - query = File.join(@path, path) - exts.each do |ext| - query << "{" - ext.compact.uniq.each { |e| query << ".#{e}," } - query << "}" - end - - query + File.join(@path, path) + exts.map { |ext| + "{#{ext.compact.uniq.map { |e| ".#{e}," }.join}}" + }.join end end -- cgit v1.2.3