mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
hash on the template directory in order to improve cache hits
This commit is contained in:
parent
940404096f
commit
295a7fd1bb
1 changed files with 3 additions and 2 deletions
|
@ -132,10 +132,11 @@ module ActionView
|
|||
def query(path, details, formats)
|
||||
query = build_query(path, details)
|
||||
templates = []
|
||||
sanitizer = Hash.new { |h,k| h[k] = Dir["#{File.dirname(k)}/*"] }
|
||||
sanitizer = Hash.new { |h,dir| h[dir] = Dir["#{dir}/*"] }
|
||||
|
||||
Dir[query].each do |template|
|
||||
next if File.directory?(template) || !sanitizer[template].include?(template)
|
||||
next if File.directory?(template)
|
||||
next unless sanitizer[File.dirname(template)].include?(template)
|
||||
|
||||
handler, format = extract_handler_and_format(template, formats)
|
||||
contents = File.binread template
|
||||
|
|
Loading…
Reference in a new issue