Deal with the nested map loops.

...is there a better way to do this?
This commit is contained in:
Jason Felds
2013-04-28 16:24:32 -04:00
parent 9798b35a96
commit 8502c59ee2
+12 -12
View File
@@ -1817,23 +1817,23 @@ void GameState::StoreRankingName( PlayerNumber pn, RString sName )
if( !PREFSMAN->m_bAllowMultipleHighScoreWithSameName ) if( !PREFSMAN->m_bAllowMultipleHighScoreWithSameName )
{ {
// erase all but the highest score for each name // erase all but the highest score for each name
FOREACHM( SongID, Profile::HighScoresForASong, pProfile->m_SongHighScores, iter ) for (auto &songIter : pProfile->m_SongHighScores)
FOREACHM( StepsID, Profile::HighScoresForASteps, iter->second.m_StepsHighScores, iter2 ) for (auto &stepIter : songIter.second.m_StepsHighScores)
iter2->second.hsl.RemoveAllButOneOfEachName(); stepIter.second.hsl.RemoveAllButOneOfEachName();
FOREACHM( CourseID, Profile::HighScoresForACourse, pProfile->m_CourseHighScores, iter ) for (auto &courseIter : pProfile->m_CourseHighScores)
FOREACHM( TrailID, Profile::HighScoresForATrail, iter->second.m_TrailHighScores, iter2 ) for (auto &trailIter : courseIter.second.m_TrailHighScores)
iter2->second.hsl.RemoveAllButOneOfEachName(); trailIter.second.hsl.RemoveAllButOneOfEachName();
} }
// clamp high score sizes // clamp high score sizes
FOREACHM( SongID, Profile::HighScoresForASong, pProfile->m_SongHighScores, iter ) for (auto &songIter : pProfile->m_SongHighScores)
FOREACHM( StepsID, Profile::HighScoresForASteps, iter->second.m_StepsHighScores, iter2 ) for (auto &stepIter : songIter.second.m_StepsHighScores)
iter2->second.hsl.ClampSize( true ); stepIter.second.hsl.ClampSize( true );
FOREACHM( CourseID, Profile::HighScoresForACourse, pProfile->m_CourseHighScores, iter ) for (auto &courseIter : pProfile->m_CourseHighScores)
FOREACHM( TrailID, Profile::HighScoresForATrail, iter->second.m_TrailHighScores, iter2 ) for (auto &trailIter : courseIter.second.m_TrailHighScores)
iter2->second.hsl.ClampSize( true ); trailIter.second.hsl.ClampSize( true );
} }
bool GameState::AllAreInDangerOrWorse() const bool GameState::AllAreInDangerOrWorse() const