No need to check for zero value in a sorted set.

This commit is contained in:
Bartosz Taudul 2018-09-01 13:55:25 +02:00
parent 0c086e3a30
commit 213b33a4fa

View File

@ -6457,27 +6457,25 @@ void View::DrawInfo()
{ {
const auto tMinLog = log10fast( tmin ); const auto tMinLog = log10fast( tmin );
const auto idt = numBins / ( log10fast( tmax ) - tMinLog ); const auto idt = numBins / ( log10fast( tmax ) - tMinLog );
for( auto& ft : frames ) auto fit = frames.begin();
while( fit != frames.end() && *fit == 0 ) fit++;
while( fit != frames.end() )
{ {
if( ft != 0 ) const auto bin = std::min( numBins - 1, int64_t( ( log10fast( *fit++ ) - tMinLog ) * idt ) );
{
const auto bin = std::min( numBins - 1, int64_t( ( log10fast( ft ) - tMinLog ) * idt ) );
bins[bin]++; bins[bin]++;
} }
} }
}
else else
{ {
const auto idt = numBins / dt; const auto idt = numBins / dt;
for( auto& ft : frames ) auto fit = frames.begin();
while( fit != frames.end() && *fit == 0 ) fit++;
while( fit != frames.end() )
{ {
if( ft != 0 ) const auto bin = std::min( numBins - 1, int64_t( ( *fit++ - tmin ) * idt ) );
{
const auto bin = std::min( numBins - 1, int64_t( ( ft - tmin ) * idt ) );
bins[bin]++; bins[bin]++;
} }
} }
}
int64_t maxVal = bins[0]; int64_t maxVal = bins[0];
for( int i=1; i<numBins; i++ ) for( int i=1; i<numBins; i++ )