From 928cbb826bcad4d75ea7e15cec0f6cc3285f6521 Mon Sep 17 00:00:00 2001 From: "born a rick, raised a morty, died a jerry" Date: Tue, 14 Jul 2020 15:10:15 -0400 Subject: [PATCH] some scoreman cleanup --- src/Etterna/Singletons/ScoreManager.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Etterna/Singletons/ScoreManager.cpp b/src/Etterna/Singletons/ScoreManager.cpp index 480988539c..3900fe099c 100644 --- a/src/Etterna/Singletons/ScoreManager.cpp +++ b/src/Etterna/Singletons/ScoreManager.cpp @@ -481,15 +481,15 @@ ScoreManager::RecalculateSSRs(LoadingWindow* ld) [&songVectorPtrMutex, ¤tlyLockedSongs]( std::pair, vectorIt> workload, ThreadData* data) { - auto per_thread_calc = std::make_unique(); + const auto per_thread_calc = std::make_unique(); auto* pair = static_cast*>(data->data); - auto onePercent = pair->first; + const auto onePercent = pair->first; auto* ld = pair->second; auto scoreIndex = 0; auto lastUpdate = 0; - for (auto it = workload.first; it != workload.second; it++) { + for (auto it = workload.first; it != workload.second; ++it) { auto* hs = *it; if ((ld != nullptr) && scoreIndex % onePercent == 0) { data->_progress += scoreIndex - lastUpdate; @@ -512,8 +512,8 @@ ScoreManager::RecalculateSSRs(LoadingWindow* ld) songVectorPtrMutex, reinterpret_cast(steps->m_pSong)); - auto ssrpercent = hs->GetSSRNormPercent(); - auto musicrate = hs->GetMusicRate(); + const auto ssrpercent = hs->GetSSRNormPercent(); + const auto musicrate = hs->GetMusicRate(); // ghasgh we need to decompress to get maxpoints auto* td = steps->GetTimingData(); @@ -523,7 +523,7 @@ ScoreManager::RecalculateSSRs(LoadingWindow* ld) if (hs->GetWifeVersion() != 3 && !hs->GetChordCohesion() && hs->HasReplayData()) { steps->GetNoteData(nd); - auto maxpoints = nd.WifeTotalScoreCalc(td); + const auto maxpoints = nd.WifeTotalScoreCalc(td); if (maxpoints <= 0) { continue; } @@ -598,7 +598,7 @@ ScoreManager::RecalculateSSRs(LoadingWindow* ld) * up to this point should be a fully completed pass. This will * also allow us to mark files with 0 chords as being nocc * (since it doesn't apply to them). */ - auto totalstepsnotes = + const auto totalstepsnotes = steps->GetRadarValues()[RadarCategory_Notes]; auto totalscorenotes = 0; totalscorenotes += hs->GetTapNoteScore(TNS_W1); @@ -690,10 +690,10 @@ ScoreManager::RecalculateSSRs(const string& profileID) [&songVectorPtrMutex, ¤tlyLockedSongs]( std::pair, vectorIt> workload, ThreadData* data) { - auto per_thread_calc = std::make_unique(); + const auto per_thread_calc = std::make_unique(); auto scoreIndex = 0; - for (auto it = workload.first; it != workload.second; it++) { + for (auto it = workload.first; it != workload.second; ++it) { auto* hs = *it; ++scoreIndex; @@ -706,7 +706,7 @@ ScoreManager::RecalculateSSRs(const string& profileID) continue; } - auto ssrpercent = hs->GetSSRNormPercent(); + const auto ssrpercent = hs->GetSSRNormPercent(); // don't waste time on <= 0%s if (ssrpercent <= 0.f || !steps->IsRecalcValid()) { @@ -717,7 +717,7 @@ ScoreManager::RecalculateSSRs(const string& profileID) songVectorPtrMutex, reinterpret_cast(steps->m_pSong)); - auto musicrate = hs->GetMusicRate(); + const auto musicrate = hs->GetMusicRate(); auto* td = steps->GetTimingData(); NoteData nd;