From ff1902789d45190dd298b65342699d6043dd8ef2 Mon Sep 17 00:00:00 2001 From: Genadi Samokovarov Date: Thu, 13 Nov 2014 23:59:45 +0100 Subject: Don't double check trace origin in ExceptionWrapper#traces If a trace isn't an application one, then it comes from a framework. That's the definition of framework trace. We can speed up the traces generation if we don't double check that. --- actionpack/lib/action_dispatch/middleware/exception_wrapper.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb b/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb index b8381aba70..edd98c5cf2 100644 --- a/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb +++ b/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb @@ -65,8 +65,12 @@ module ActionDispatch full_trace.each_with_index do |trace, idx| trace_with_id = { id: idx, trace: trace } - appplication_trace_with_ids << trace_with_id if application_trace.include?(trace) - framework_trace_with_ids << trace_with_id if framework_trace.include?(trace) + if application_trace.include?(trace) + appplication_trace_with_ids << trace_with_id + else + framework_trace_with_ids << trace_with_id + end + full_trace_with_ids << trace_with_id end -- cgit v1.2.3