From c759c4770fee323d0b27a2bfd7b0b920121ebddf Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Wed, 1 May 2013 21:41:20 -0400 Subject: [PATCH] Loop and efficiency boost. No need to loop the structure twice. --- src/NoteField.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/NoteField.cpp b/src/NoteField.cpp index 162376ec26..e30c830725 100644 --- a/src/NoteField.cpp +++ b/src/NoteField.cpp @@ -127,11 +127,11 @@ void NoteField::CacheAllUsedNoteSkins() vector asSkinsLower; GAMESTATE->GetAllUsedNoteSkins( asSkinsLower ); asSkinsLower.push_back( m_pPlayerState->m_PlayerOptions.GetStage().m_sNoteSkin ); - FOREACH( RString, asSkinsLower, s ) - s->MakeLower(); - - for( unsigned i=0; i < asSkinsLower.size(); ++i ) - CacheNoteSkin( asSkinsLower[i] ); + for (RString &s : asSkinsLower) + { + s.MakeLower(); + CacheNoteSkin(s); + } /* If we're changing note skins in the editor, we can have old note skins lying * around. Remove them so they don't accumulate. */