Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

refactor the optimized build_query a bit

  • Loading branch information...
commit 37b77c6ae7effdba51ecd8b3b91e2cdb0020b6aa 1 parent 128467e
@tenderlove tenderlove authored
Showing with 3 additions and 8 deletions.
  1. +3 −8 actionpack/lib/action_view/template/resolver.rb
View
11 actionpack/lib/action_view/template/resolver.rb
@@ -237,15 +237,10 @@ def eql?(resolver)
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

1 comment on commit 37b77c6

@josevalim
Owner

Bro, is this way faster for sure? Y U NO use << instead + for strings? The resolver and the partial renderer are one of the parts of the rails we have optimized consistently.

Please sign in to comment.
Something went wrong with that request. Please try again.