From 759fd15c039f640f53d6ca31f4c1cacd4676f437 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 23 Feb 2020 15:35:08 +0100 Subject: [PATCH] Don't load vector size twice. --- server/TracyWorker.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 9c6fcd32..67e3a173 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -2757,14 +2757,15 @@ void Worker::NewZone( ZoneEvent* zone, uint64_t thread ) auto td = m_threadCtxData; if( !td ) td = m_threadCtxData = NoticeThread( thread ); td->count++; - if( td->stack.empty() ) + const auto ssz = td->stack.size(); + if( ssz == 0 ) { td->stack.push_back( zone ); td->timeline.push_back( zone ); } else { - auto& back = td->stack.back(); + auto& back = td->stack.data()[ssz-1]; if( !back->HasChildren() ) { back->SetChild( int32_t( m_data.zoneChildren.size() ) );