提交 9fedae27 编写于 作者: J Justin Collins

Ignore identically rendered templates

上级 9146de53
......@@ -129,6 +129,14 @@ module Brakeman::RenderHelper
#TODO: Add in :locals => { ... } to environment
src = Brakeman::TemplateAliasProcessor.new(@tracker, template, called_from).process_safely(template[:src], template_env)
digest = Digest::SHA1.new.update(name + src.to_s).to_s.to_sym
if @tracker.template_cache.include? digest
return
else
@tracker.template_cache << digest
end
#Run alias-processed src through the template processor to pull out
#information and outputs.
#This information will be stored in tracker.templates, but with a name
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册