From 36349c22133ee7885c5ce0cd2416854288b8d3b7 Mon Sep 17 00:00:00 2001 From: Justin Collins Date: Mon, 12 Nov 2012 17:31:55 -0800 Subject: [PATCH] Only convert call target to string if symbol The only thing this is used for is matching regexes against known call targets. We only want to store these strings if the call target is a symbol, not a full Sexp. Big performance improvement for large apps. --- lib/brakeman/call_index.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/brakeman/call_index.rb b/lib/brakeman/call_index.rb index 10882c6a..db02b985 100644 --- a/lib/brakeman/call_index.rb +++ b/lib/brakeman/call_index.rb @@ -106,7 +106,7 @@ class Brakeman::CallIndex def index_calls calls calls.each do |call| @methods << call[:method].to_s - @targets << call[:target].to_s + @targets << call[:target].to_s if call[:target].is_a? Symbol @calls_by_method[call[:method]] << call @calls_by_target[call[:target]] << call end -- GitLab