mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 07:54:36 +00:00
Replace previous iterator manipulation with a boolean.
This commit is contained in:
parent
efa095e25f
commit
1e63406ac7
@ -472,11 +472,15 @@ void TimelineItemThread::PreprocessContextSwitches( const TimelineContext& ctx,
|
|||||||
const auto MinCtxNs = int64_t( round( GetScale() * MinCtxSize * nspx ) );
|
const auto MinCtxNs = int64_t( round( GetScale() * MinCtxSize * nspx ) );
|
||||||
const auto& sampleData = m_thread->samples;
|
const auto& sampleData = m_thread->samples;
|
||||||
|
|
||||||
auto pit = citend;
|
bool first = true;
|
||||||
while( it < citend )
|
while( it < citend )
|
||||||
{
|
{
|
||||||
auto& ev = *it;
|
auto& ev = *it;
|
||||||
if( pit != citend )
|
if( first )
|
||||||
|
{
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
uint32_t waitStack = 0;
|
uint32_t waitStack = 0;
|
||||||
if( !sampleData.empty() )
|
if( !sampleData.empty() )
|
||||||
@ -513,12 +517,10 @@ void TimelineItemThread::PreprocessContextSwitches( const TimelineContext& ctx,
|
|||||||
}
|
}
|
||||||
m_ctxDraw.emplace_back( ContextSwitchDraw { ContextSwitchDrawType::Folded, uint32_t( it - vec.begin() ), uint32_t( next - it ) } );
|
m_ctxDraw.emplace_back( ContextSwitchDraw { ContextSwitchDrawType::Folded, uint32_t( it - vec.begin() ), uint32_t( next - it ) } );
|
||||||
it = next;
|
it = next;
|
||||||
pit = it-1;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_ctxDraw.emplace_back( ContextSwitchDraw { ContextSwitchDrawType::Running, uint32_t( it - vec.begin() ) } );
|
m_ctxDraw.emplace_back( ContextSwitchDraw { ContextSwitchDrawType::Running, uint32_t( it - vec.begin() ) } );
|
||||||
pit = it;
|
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user