From c9da5f1474195f9c8b3fea9c345ccec0901a9bb8 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 24 Oct 2019 22:34:18 +0200 Subject: [PATCH] Use cached thread retriever. --- server/TracyWorker.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 1c19b84c..9d4465ba 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -3442,14 +3442,13 @@ void Worker::ProcessZoneBeginAllocSrcLocCallstack( const QueueZoneBegin& ev ) void Worker::ProcessZoneEnd( const QueueZoneEnd& ev ) { - auto tit = m_threadMap.find( m_threadCtx ); - if( tit == m_threadMap.end() || tit->second->zoneIdStack.empty() ) + auto td = RetrieveThread( m_threadCtx ); + if( !td ) { ZoneEndFailure( m_threadCtx ); return; } - auto td = tit->second; auto zoneId = td->zoneIdStack.back_and_pop(); if( zoneId != td->nextZoneId ) { @@ -3710,14 +3709,13 @@ void Worker::ProcessFrameImage( const QueueFrameImage& ev ) void Worker::ProcessZoneText( const QueueZoneText& ev ) { - auto tit = m_threadMap.find( m_threadCtx ); - if( tit == m_threadMap.end() || tit->second->stack.empty() || tit->second->nextZoneId != tit->second->zoneIdStack.back() ) + auto td = RetrieveThread( m_threadCtx ); + if( !td || td->stack.empty() || td->nextZoneId != td->zoneIdStack.back() ) { ZoneTextFailure( m_threadCtx ); return; } - auto td = tit->second; td->nextZoneId = 0; auto& stack = td->stack; auto zone = stack.back(); @@ -3729,14 +3727,13 @@ void Worker::ProcessZoneText( const QueueZoneText& ev ) void Worker::ProcessZoneName( const QueueZoneText& ev ) { - auto tit = m_threadMap.find( m_threadCtx ); - if( tit == m_threadMap.end() || tit->second->stack.empty() || tit->second->nextZoneId != tit->second->zoneIdStack.back() ) + auto td = RetrieveThread( m_threadCtx ); + if( !td || td->stack.empty() || td->nextZoneId != td->zoneIdStack.back() ) { ZoneNameFailure( m_threadCtx ); return; } - auto td = tit->second; td->nextZoneId = 0; auto& stack = td->stack; auto zone = stack.back();