From 6140fd2210cad1067191c9c73462adb20069f72a Mon Sep 17 00:00:00 2001 From: MinaciousGrace Date: Mon, 5 Jun 2017 08:08:59 -0400 Subject: [PATCH] clean up some code related to the previous commit --- src/SongManager.cpp | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/src/SongManager.cpp b/src/SongManager.cpp index 8bf6cfa878..5edd9f9222 100644 --- a/src/SongManager.cpp +++ b/src/SongManager.cpp @@ -723,38 +723,26 @@ bool SongManager::IsGroupNeverCached(const RString& group) const } void SongManager::SetFavoritedStatus(set& favs) { - FOREACH(Song*, m_pSongs, song) { - FOREACH_CONST(Steps*, (*song)->GetAllSteps(), steps) { - RString sck = (*steps)->GetChartKey(); - FOREACHS(string, favs, ck) - if (sck == *ck) - (*song)->SetFavorited(true); - } - } + FOREACH(Song*, m_pSongs, song) + FOREACH_CONST(Steps*, (*song)->GetAllSteps(), steps) + if (favs.count((*steps)->GetChartKey())) + (*song)->SetFavorited(true); } void SongManager::SetPermaMirroredStatus(set& pmir) { - FOREACH(Song*, m_pSongs, song) { - FOREACH_CONST(Steps*, (*song)->GetAllSteps(), steps) { - RString sck = (*steps)->GetChartKey(); - FOREACHS(string, pmir, ck) - if (sck == *ck) - (*song)->SetPermaMirror(true); - } - } + FOREACH(Song*, m_pSongs, song) + FOREACH_CONST(Steps*, (*song)->GetAllSteps(), steps) + if (pmir.count((*steps)->GetChartKey())) + (*song)->SetPermaMirror(true); } // hurr should probably redo both (all three) of these -mina void SongManager::SetHasGoal(map> goalmap) { - FOREACH(Song*, m_pSongs, song) { - FOREACH_CONST(Steps*, (*song)->GetAllSteps(), steps) { - RString sck = (*steps)->GetChartKey(); - auto it = goalmap.find(sck); - if(it != goalmap.end()) + FOREACH(Song*, m_pSongs, song) + FOREACH_CONST(Steps*, (*song)->GetAllSteps(), steps) + if(goalmap.count((*steps)->GetChartKey())) (*song)->SetHasGoal(true); - } - } - } +} RString SongManager::GetSongGroupBannerPath( const RString &sSongGroup ) const {