Don't iterate over every StepsType in existence when we already know exactly which StepsTypes we want.
This commit is contained in:
+4
-12
@@ -2927,19 +2927,11 @@ 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);
|
||||||
{
|
aStepsTypeAddTo.push_back( st );
|
||||||
const Style *style = pGame->m_apStyles[s];
|
|
||||||
if( style->m_StepsType != st )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
found = true;
|
|
||||||
}
|
|
||||||
if( found )
|
|
||||||
aStepsTypeAddTo.push_back( st );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user