Performance: Move bool outside cell loop

This commit is contained in:
Magne Sjaastad 2022-06-15 15:28:32 +02:00 committed by Kristian Bendiksen
parent 226ac4f2b6
commit 36e43ae85b

View File

@ -67,8 +67,9 @@ private:
return;
}
const RigActiveCellInfo* actCellInfo = m_caseData->activeCellInfo();
size_t cellCount = actCellInfo->reservoirCellCount();
const RigActiveCellInfo* actCellInfo = m_caseData->activeCellInfo();
size_t cellCount = actCellInfo->reservoirCellCount();
bool isUsingGlobalActiveIndex = m_caseData->isUsingGlobalActiveIndex( m_resultAddress );
CVF_TIGHT_ASSERT( cellCount == m_cellVisibilities->size() );
@ -77,7 +78,7 @@ private:
if ( !( *m_cellVisibilities )[cIdx] ) continue;
size_t cellResultIndex = cIdx;
if ( m_caseData->isUsingGlobalActiveIndex( m_resultAddress ) )
if ( isUsingGlobalActiveIndex )
{
cellResultIndex = actCellInfo->cellResultIndex( cIdx );
}