From dfe924a64d04ecf02b524d4609446784e2ab7d37 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sat, 27 Apr 2013 14:00:31 -0400 Subject: [PATCH] Simplify, be explicit. --- src/SongUtil.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/SongUtil.cpp b/src/SongUtil.cpp index 477eb2a882..c167a83b13 100644 --- a/src/SongUtil.cpp +++ b/src/SongUtil.cpp @@ -963,9 +963,9 @@ void SongUtil::GetPlayableStepsTypes( const Song *pSong, set &vOut ) * stages left to play. */ // this being const may have caused some problems... -aj const vector &vstToShow = CommonMetrics::STEPS_TYPES_TO_SHOW.GetValue(); - FOREACHS( StepsType, vStepsTypes, st ) + for (StepsType const &type : vStepsTypes) { - bool bShowThisStepsType = find( vstToShow.begin(), vstToShow.end(), *st ) != vstToShow.end(); + bool bShowThisStepsType = find( vstToShow.begin(), vstToShow.end(), type ) != vstToShow.end(); int iNumPlayers = GAMESTATE->GetNumPlayersEnabled(); iNumPlayers = max( iNumPlayers, 1 ); @@ -975,7 +975,7 @@ void SongUtil::GetPlayableStepsTypes( const Song *pSong, set &vOut ) GAMESTATE->GetNumStagesMultiplierForSong(pSong); if( bShowThisStepsType && bEnoughStages ) - vOut.insert( *st ); + vOut.insert( type ); } } @@ -984,8 +984,8 @@ void SongUtil::GetPlayableSteps( const Song *pSong, vector &vOut ) set vStepsType; GetPlayableStepsTypes( pSong, vStepsType ); - FOREACHS( StepsType, vStepsType, st ) - SongUtil::GetSteps( pSong, vOut, *st ); + for (StepsType const &type : vStepsType) + SongUtil::GetSteps( pSong, vOut, type ); StepsUtil::RemoveLockedSteps( pSong, vOut ); StepsUtil::SortNotesArrayByDifficulty( vOut );