diff --git a/server/TracyVector.hpp b/server/TracyVector.hpp index d7a30f72..41b808a0 100644 --- a/server/TracyVector.hpp +++ b/server/TracyVector.hpp @@ -153,6 +153,13 @@ public: m_size--; } + T& back_and_pop() + { + assert( m_size > 0 ); + m_size--; + return m_ptr[m_size]; + } + void reserve( size_t cap ) { if( cap == 0 || cap <= Capacity() ) return; diff --git a/server/TracyView.cpp b/server/TracyView.cpp index bf6e04b7..36e879cf 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -662,8 +662,7 @@ void View::ProcessZoneEnd( const QueueZoneEnd& ev ) auto td = tit->second; auto& stack = td->stack; assert( !stack.empty() ); - auto zone = stack.back(); - stack.pop_back(); + auto zone = stack.back_and_pop(); assert( zone->end == -1 ); zone->end = ev.time * m_timerMul; assert( ev.cpu == 0xFFFFFFFF || ev.cpu <= std::numeric_limits::max() );