From 7bdfc454aee05d3d1bef319a7441804be3e5395d Mon Sep 17 00:00:00 2001 From: "Devin J. Pohly" Date: Fri, 25 Jan 2013 17:03:45 -0500 Subject: [PATCH] obviate goto by reordering logic --- src/GameSoundManager.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/GameSoundManager.cpp b/src/GameSoundManager.cpp index b00536789a..e7256efed2 100644 --- a/src/GameSoundManager.cpp +++ b/src/GameSoundManager.cpp @@ -647,23 +647,22 @@ void GameSoundManager::Update( float fDeltaTime ) FOREACH_CabinetLight( cl ) { - // for each index we crossed since the last update: + // Are we "holding" the light? + if( lights.IsHoldNoteAtRow( cl, iSongRow ) ) + { + LIGHTSMAN->BlinkCabinetLight( cl ); + continue; + } + + // Otherwise, for each index we crossed since the last update: FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( lights, cl, r, iRowLastCrossed+1, iSongRow+1 ) { if( lights.GetTapNote( cl, r ).type != TapNote::empty ) { LIGHTSMAN->BlinkCabinetLight( cl ); - goto done_with_cabinet_light; + break; } } - - if( lights.IsHoldNoteAtRow( cl, iSongRow ) ) - { - LIGHTSMAN->BlinkCabinetLight( cl ); - goto done_with_cabinet_light; - } -done_with_cabinet_light: - ; } iRowLastCrossed = iSongRow;