Perform search after condition was verified, not before.

This commit is contained in:
Bartosz Taudul 2018-03-18 20:24:35 +01:00
parent 3ac98beb5a
commit 40c6f01a41

View File

@ -1241,11 +1241,11 @@ void Worker::ProcessZoneEnd( const QueueZoneEnd& ev )
m_data.lastTime = std::max( m_data.lastTime, zone->end );
#ifndef TRACY_NO_STATISTICS
auto it = m_data.sourceLocationZones.find( zone->srcloc );
assert( it != m_data.sourceLocationZones.end() );
const auto timeSpan = zone->end - zone->start;
if( timeSpan > 0 )
{
auto it = m_data.sourceLocationZones.find( zone->srcloc );
assert( it != m_data.sourceLocationZones.end() );
it->second.min = std::min( it->second.min, timeSpan );
it->second.max = std::max( it->second.max, timeSpan );
}