Optimize itemset
When counting items, many cases exist where we want to count all items without checking flags. This short-circuits the loop to provide the immediate count.
This commit is contained in:
parent
4c7f5f2a2f
commit
dbc2eea3db
|
@ -120,6 +120,9 @@ public:
|
|||
{
|
||||
int n = 0;
|
||||
|
||||
if( aKindMask == -1 || aKindMask == ITEM::ANY_T )
|
||||
return m_items.size();
|
||||
|
||||
for( ITEM* item : m_items )
|
||||
{
|
||||
if( item->Kind() & aKindMask )
|
||||
|
|
Loading…
Reference in New Issue