Only write to memory if value has changed.

This commit is contained in:
Bartosz Taudul 2019-10-25 21:28:55 +02:00
parent 779063a18b
commit b5419944aa

View File

@ -4851,8 +4851,8 @@ void Worker::ReadTimelineUpdateStatistics( ZoneEvent* zone, uint16_t thread )
auto timeSpan = zone->End() - zone->Start(); auto timeSpan = zone->End() - zone->Start();
if( timeSpan > 0 ) if( timeSpan > 0 )
{ {
slz.min = std::min( slz.min, timeSpan ); if( slz.min > timeSpan ) slz.min = timeSpan;
slz.max = std::max( slz.max, timeSpan ); if( slz.max < timeSpan ) slz.max = timeSpan;
slz.total += timeSpan; slz.total += timeSpan;
slz.sumSq += double( timeSpan ) * timeSpan; slz.sumSq += double( timeSpan ) * timeSpan;
if( zone->Child() >= 0 ) if( zone->Child() >= 0 )
@ -4863,8 +4863,8 @@ void Worker::ReadTimelineUpdateStatistics( ZoneEvent* zone, uint16_t thread )
timeSpan -= childSpan; timeSpan -= childSpan;
} }
} }
slz.selfMin = std::min( slz.selfMin, timeSpan ); if( slz.selfMin > timeSpan ) slz.selfMin = timeSpan;
slz.selfMax = std::max( slz.selfMax, timeSpan ); if( slz.selfMax < timeSpan ) slz.selfMax = timeSpan;
slz.selfTotal += timeSpan; slz.selfTotal += timeSpan;
} }
} }