mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 00:04:35 +00:00
Move bin setup closer to bin usage.
This commit is contained in:
parent
761405e2a7
commit
14398dd4e8
@ -6246,22 +6246,6 @@ void View::DrawFindZone()
|
||||
const auto numBins = int64_t( w - 4 );
|
||||
if( numBins > 1 )
|
||||
{
|
||||
if( numBins > m_findZone.numBins )
|
||||
{
|
||||
m_findZone.numBins = numBins;
|
||||
m_findZone.bins = std::make_unique<int64_t[]>( numBins );
|
||||
m_findZone.binTime = std::make_unique<int64_t[]>( numBins );
|
||||
m_findZone.selBin = std::make_unique<int64_t[]>( numBins );
|
||||
}
|
||||
|
||||
const auto& bins = m_findZone.bins;
|
||||
const auto& binTime = m_findZone.binTime;
|
||||
const auto& selBin = m_findZone.selBin;
|
||||
|
||||
memset( bins.get(), 0, sizeof( int64_t ) * numBins );
|
||||
memset( binTime.get(), 0, sizeof( int64_t ) * numBins );
|
||||
memset( selBin.get(), 0, sizeof( int64_t ) * numBins );
|
||||
|
||||
int64_t selectionTime = 0;
|
||||
const auto s = std::min( m_findZone.highlight.start, m_findZone.highlight.end );
|
||||
const auto e = std::max( m_findZone.highlight.start, m_findZone.highlight.end );
|
||||
@ -6323,6 +6307,22 @@ void View::DrawFindZone()
|
||||
timeTotal = tmax - tmin;
|
||||
}
|
||||
|
||||
if( numBins > m_findZone.numBins )
|
||||
{
|
||||
m_findZone.numBins = numBins;
|
||||
m_findZone.bins = std::make_unique<int64_t[]>( numBins );
|
||||
m_findZone.binTime = std::make_unique<int64_t[]>( numBins );
|
||||
m_findZone.selBin = std::make_unique<int64_t[]>( numBins );
|
||||
}
|
||||
|
||||
const auto& bins = m_findZone.bins;
|
||||
const auto& binTime = m_findZone.binTime;
|
||||
const auto& selBin = m_findZone.selBin;
|
||||
|
||||
memset( bins.get(), 0, sizeof( int64_t ) * numBins );
|
||||
memset( binTime.get(), 0, sizeof( int64_t ) * numBins );
|
||||
memset( selBin.get(), 0, sizeof( int64_t ) * numBins );
|
||||
|
||||
if( m_findZone.logTime )
|
||||
{
|
||||
const auto tMinLog = log10( tmin );
|
||||
|
Loading…
Reference in New Issue
Block a user