From f2dbe7ccdb32408b214568dc785cf86fdfd9c564 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Wed, 1 May 2013 21:55:47 -0400 Subject: [PATCH] Utilize the algorithm approach. --- src/MusicWheel.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/MusicWheel.cpp b/src/MusicWheel.cpp index 267463444e..0597cb5150 100644 --- a/src/MusicWheel.cpp +++ b/src/MusicWheel.cpp @@ -1594,14 +1594,9 @@ Song *MusicWheel::GetPreferredSelectionForRandomOrPortal() if( i < 900 && pSong->IsTutorial() ) continue; - FOREACH( Difficulty, vDifficultiesToRequire, d ) - { - if( !pSong->HasStepsTypeAndDifficulty(st,*d) ) - { - isValid = false; - break; - } - } + isValid = std::none_of(vDifficultiesToRequire.begin(), vDifficultiesToRequire.end(), [&](Difficulty const &d) { + return !pSong->HasStepsTypeAndDifficulty(st, d); + }); if (isValid) {