From fb06985b6460ba2e693a2c0aef2b267304627b22 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Thu, 24 Jan 2013 22:54:02 -0500 Subject: [PATCH] Another goto goes away. As far as if a variable should be made in the loop or out of it...consider that up for debate. --- src/MusicWheel.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/MusicWheel.cpp b/src/MusicWheel.cpp index e1c1bd4760..64e7650185 100644 --- a/src/MusicWheel.cpp +++ b/src/MusicWheel.cpp @@ -1574,6 +1574,7 @@ Song *MusicWheel::GetPreferredSelectionForRandomOrPortal() #define NUM_PROBES 1000 for( int i=0; iHasStepsTypeAndDifficulty(st,*d) ) - goto try_next; - return wid[iSelection]->m_pSong; -try_next: - ; + { + isValid = false; + break; + } + } + + if (isValid) + { + return wid[iSelection]->m_pSong; + } } LOG->Warn( "Couldn't find any songs" ); return wid[0]->m_pSong;