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:
Seth Hillbrand 2018-05-07 13:51:40 -07:00
parent 4c7f5f2a2f
commit dbc2eea3db
1 changed files with 3 additions and 0 deletions

View File

@ -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 )