From b67989ab54c0f66dcea3fbdc2dde1eec0c5f34a9 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 9 Dec 2017 19:24:35 +0100 Subject: [PATCH] No need for nextState variable. --- server/TracyView.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index ad2e0280..3cd3476b 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -2913,8 +2913,7 @@ int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos, drawn = true; LockState drawState = state; - LockState nextState; - auto next = GetNextLockEvent( vbegin, vend, state, nextState, threadBit ); + auto next = GetNextLockEvent( vbegin, vend, state, state, threadBit ); const auto t0 = (*vbegin)->time; int64_t t1 = next == tl.end() ? GetLastTime() : (*next)->time; @@ -2927,7 +2926,7 @@ int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos, { if( next >= vend || px1 - tx0 > MinVisSize ) break; auto n = next; - auto ns = nextState; + auto ns = state; while( n < vend && ( ns == LockState::Nothing || ( m_onlyContendedLocks && ns == LockState::HasLock ) ) ) { n = GetNextLockEvent( n, vend, ns, ns, threadBit ); @@ -2937,7 +2936,7 @@ int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos, { n = GetNextLockEvent( n, vend, ns, ns, threadBit ); } - drawState = CombineLockState( drawState, nextState ); + drawState = CombineLockState( drawState, state ); condensed++; const auto t2 = n == tl.end() ? GetLastTime() : (*n)->time; const auto px2 = ( t2 - m_zvStart ) * pxns; @@ -2947,7 +2946,7 @@ int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos, tx0 = px1; px1 = px2; next = n; - nextState = ns; + state = ns; } pxend = std::max( { px1, px0+MinVisSize, px0 + pxns * 0.5 } ); @@ -3119,7 +3118,6 @@ int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos, } vbegin = next; - state = nextState; } if( drawn )