Optimize hot loop in UpdateItems.

This commit is contained in:
Alex 2022-11-19 04:02:05 +05:00
parent 11dddefd05
commit d3aed6c408
1 changed files with 8 additions and 7 deletions

View File

@ -1401,7 +1401,7 @@ void VIEW::UpdateItems()
return;
unsigned int cntGeomUpdate = 0;
unsigned int cntAnyUpdate = 0;
bool anyUpdated = false;
for( VIEW_ITEM* item : *m_allItems )
{
@ -1410,13 +1410,14 @@ void VIEW::UpdateItems()
if( !vpd )
continue;
if( vpd->m_requiredUpdate & ( GEOMETRY | LAYERS ) )
{
cntGeomUpdate++;
}
if( vpd->m_requiredUpdate != NONE )
{
cntAnyUpdate++;
anyUpdated = true;
if( vpd->m_requiredUpdate & ( GEOMETRY | LAYERS ) )
{
cntGeomUpdate++;
}
}
}
@ -1456,7 +1457,7 @@ void VIEW::UpdateItems()
}
}
if( cntAnyUpdate )
if( anyUpdated )
{
GAL_UPDATE_CONTEXT ctx( m_gal );