Don't iterate over every StepsType in existence when we already know exactly which StepsTypes we want.

This commit is contained in:
Ben "root" Anderson
2013-11-25 20:58:04 -06:00
parent 49265cfc2e
commit 2b73f4b5ec
+3 -11
View File
@@ -2927,18 +2927,10 @@ const Style* GameManager::GetEditorStyleForStepsType( StepsType st )
void GameManager::GetStepsTypesForGame( const Game *pGame, vector<StepsType>& aStepsTypeAddTo ) void GameManager::GetStepsTypesForGame( const Game *pGame, vector<StepsType>& aStepsTypeAddTo )
{ {
FOREACH_ENUM( StepsType, st ) for( int i=0; pGame->m_apStyles[i]; ++i )
{ {
bool found = false; const StepsType st = pGame->m_apStyles[i]->m_StepsType;
for( int s=0; pGame->m_apStyles[s]; ++s ) ASSERT(st < NUM_StepsType);
{
const Style *style = pGame->m_apStyles[s];
if( style->m_StepsType != st )
continue;
found = true;
}
if( found )
aStepsTypeAddTo.push_back( st ); aStepsTypeAddTo.push_back( st );
} }
} }