Replace loop with any_of.
This commit is contained in:
@@ -137,16 +137,9 @@ void ScreenPlayerOptions::UpdateDisqualified( int row, PlayerNumber pn )
|
|||||||
m_bRowCausesDisqualified[pn][row] = bRowCausesDisqualified;
|
m_bRowCausesDisqualified[pn][row] = bRowCausesDisqualified;
|
||||||
|
|
||||||
// Update disqualified graphic
|
// Update disqualified graphic
|
||||||
bool bDisqualified = false;
|
bool disqualified = std::any_of(m_bRowCausesDisqualified[pn].begin(), m_bRowCausesDisqualified[pn].end(), [](bool const &b) { return b; });
|
||||||
FOREACH_CONST( bool, m_bRowCausesDisqualified[pn], b )
|
|
||||||
{
|
m_sprDisqualify[pn]->SetVisible( disqualified );
|
||||||
if( *b )
|
|
||||||
{
|
|
||||||
bDisqualified = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
m_sprDisqualify[pn]->SetVisible( bDisqualified );
|
|
||||||
|
|
||||||
// restore previous player options in case the user escapes back after this
|
// restore previous player options in case the user escapes back after this
|
||||||
GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.Assign( ModsLevel_Preferred, poOrig );
|
GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.Assign( ModsLevel_Preferred, poOrig );
|
||||||
|
|||||||
Reference in New Issue
Block a user