Few loops here.
This commit is contained in:
@@ -108,12 +108,12 @@ void ScreenOptionsManageProfiles::BeginScreen()
|
||||
|
||||
PROFILEMAN->GetLocalProfileIDs( m_vsLocalProfileID );
|
||||
|
||||
FOREACH_CONST( RString, m_vsLocalProfileID, s )
|
||||
for (RString const &s : m_vsLocalProfileID)
|
||||
{
|
||||
Profile *pProfile = PROFILEMAN->GetLocalProfile( *s );
|
||||
Profile *pProfile = PROFILEMAN->GetLocalProfile( s );
|
||||
ASSERT( pProfile != NULL );
|
||||
|
||||
RString sCommand = ssprintf( "gamecommand;screen,ScreenOptionsEditProfile;profileid,%s;name,dummy", s->c_str() );
|
||||
RString sCommand = ssprintf( "gamecommand;screen,ScreenOptionsEditProfile;profileid,%s;name,dummy", s.c_str() );
|
||||
OptionRowHandler *pHand = OptionRowHandlerUtil::Make( ParseCommands(sCommand) );
|
||||
OptionRowDefinition &def = pHand->m_Def;
|
||||
def.m_layoutType = LAYOUT_SHOW_ALL_IN_ROW;
|
||||
@@ -124,7 +124,7 @@ void ScreenOptionsManageProfiles::BeginScreen()
|
||||
|
||||
PlayerNumber pn = PLAYER_INVALID;
|
||||
FOREACH_PlayerNumber( p )
|
||||
if( *s == ProfileManager::m_sDefaultLocalProfileID[p].Get() )
|
||||
if( s == ProfileManager::m_sDefaultLocalProfileID[p].Get() )
|
||||
pn = p;
|
||||
if( pn != PLAYER_INVALID )
|
||||
def.m_vsChoices.push_back( PlayerNumberToLocalizedString(pn) );
|
||||
@@ -198,14 +198,16 @@ void ScreenOptionsManageProfiles::HandleScreenMessage( const ScreenMessage SM )
|
||||
if( iNumProfiles < NUM_PLAYERS )
|
||||
{
|
||||
int iFirstUnused = -1;
|
||||
FOREACH_CONST( Preference<RString>*, PROFILEMAN->m_sDefaultLocalProfileID.m_v, i )
|
||||
int index = 0;
|
||||
for (Preference<RString> const *i : PROFILEMAN->m_sDefaultLocalProfileID.m_v)
|
||||
{
|
||||
RString sLocalProfileID = (*i)->Get();
|
||||
RString sLocalProfileID = i->Get();
|
||||
if( sLocalProfileID.empty() )
|
||||
{
|
||||
iFirstUnused = i - PROFILEMAN->m_sDefaultLocalProfileID.m_v.begin();
|
||||
iFirstUnused = index;
|
||||
break;
|
||||
}
|
||||
++index;
|
||||
}
|
||||
if( iFirstUnused != -1 )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user