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).
This commit is contained in:
Bartosz Taudul 2023-03-23 01:26:35 +01:00
parent e0cc6edbfb
commit f2700b2786
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -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;