Don't iterate over 256 CPUs.

This commit is contained in:
Bartosz Taudul 2019-10-15 16:13:36 +02:00
parent eccb0b1e4a
commit 3ce6b1205f
2 changed files with 3 additions and 2 deletions

View File

@ -4406,7 +4406,8 @@ int View::DrawCpuData( int offset, double pxns, const ImVec2& wpos, bool hover,
const auto origOffset = offset;
auto cpuData = m_worker.GetCpuData();
for( int i=0; i<256; i++ )
const auto cpuCnt = m_worker.GetCpuDataCpuCount();
for( int i=0; i<cpuCnt; i++ )
{
if( !cpuData[i].cs.empty() )
{

View File

@ -1830,7 +1830,7 @@ uint64_t Worker::GetContextSwitchCount() const
uint64_t Worker::GetContextSwitchPerCpuCount() const
{
uint64_t cnt = 0;
for( int i=0; i<256; i++ )
for( int i=0; i<m_data.cpuDataCount; i++ )
{
cnt += m_data.cpuData[i].cs.size();
}