From: Zack Rusin Date: Sun, 28 Aug 2011 06:38:34 +0000 (-0400) Subject: shave a few more megs by sizing trace call list correctly X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=410a8f3e03e306cef32b55374db034882d1fb494;p=apitrace shave a few more megs by sizing trace call list correctly --- diff --git a/gui/apitrace.cpp b/gui/apitrace.cpp index 9c99cfa..f3b95dc 100644 --- a/gui/apitrace.cpp +++ b/gui/apitrace.cpp @@ -146,6 +146,7 @@ void ApiTrace::setFrameMarker(FrameMarker marker) void ApiTrace::addFrames(const QList &frames) { + QList calls; int currentFrames = m_frames.count(); int numNewFrames = frames.count(); @@ -158,8 +159,10 @@ void ApiTrace::addFrames(const QList &frames) foreach(ApiTraceFrame *frame, frames) { Q_ASSERT(this == frame->parentTrace()); numNewCalls += frame->numChildren(); - m_calls += frame->calls(); + calls += frame->calls(); } + m_calls.reserve(m_calls.count() + calls.count()); + m_calls += calls; emit endAddingFrames(); emit callsAdded(currentCalls, numNewCalls);