From f2700b2786dfa7bc813210550450bf17efb7055b Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 23 Mar 2023 01:26:35 +0100 Subject: [PATCH] Remove rather useless check. The prev == it condition could only fire on the first run of the loop, and on all subsequent runs prev (=next-1) will never be "it" anymore. Lack of this condition changes nothing, as the following lines checking for time distance between next and prev satisfy the same exit condition (i.e. next-1 will be "it" only if lower_bound does not find anything, hence next is farther away than MinVisNs). --- server/TracyTimelineItemThread.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/server/TracyTimelineItemThread.cpp b/server/TracyTimelineItemThread.cpp index cf17b2ae..f37ec998 100644 --- a/server/TracyTimelineItemThread.cpp +++ b/server/TracyTimelineItemThread.cpp @@ -358,7 +358,6 @@ int TimelineItemThread::PreprocessGhostLevel( const TimelineContext& ctx, const next = std::lower_bound( next, zitend, nextTime, [] ( const auto& l, const auto& r ) { return l.end.Val() < r; } ); if( next == zitend ) break; auto prev = next - 1; - if( prev == it ) break; const auto pt = prev->end.Val(); const auto nt = next->end.Val(); if( nt - pt >= MinVisNs ) break; @@ -432,7 +431,6 @@ int TimelineItemThread::PreprocessZoneLevel( const TimelineContext& ctx, const V next = std::lower_bound( next, zitend, nextTime, [this] ( const auto& l, const auto& r ) { Adapter a; return m_worker.GetZoneEnd( a(l) ) < r; } ); if( next == zitend ) break; auto prev = next - 1; - if( prev == it ) break; const auto pt = m_worker.GetZoneEnd( a(*prev) ); const auto nt = m_worker.GetZoneEnd( a(*next) ); if( nt - pt >= MinVisNs ) break; @@ -575,7 +573,6 @@ void TimelineItemThread::PreprocessSamples( const TimelineContext& ctx, const Ve next = std::lower_bound( next, itend, nextTime, [] ( const auto& l, const auto& r ) { return l.time.Val() < r; } ); if( next == itend ) break; auto prev = next - 1; - if( prev == it ) break; const auto pt = prev->time.Val(); const auto nt = next->time.Val(); if( nt - pt >= MinVisNs ) break;