From db1340700c2cce920eb06b9fd751396898ed1cc5 Mon Sep 17 00:00:00 2001 From: xwidghet Date: Thu, 9 Mar 2017 16:27:42 -0800 Subject: [PATCH] Directly copy the data for the chart key. --- src/Steps.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/Steps.cpp b/src/Steps.cpp index 77e800a0b0..d6572b1e21 100644 --- a/src/Steps.cpp +++ b/src/Steps.cpp @@ -491,8 +491,7 @@ map Steps::SortSkillsetsAtRate(float x, bool includeoverall) { RString Steps::GenerateChartKey(NoteData& nd, TimingData *td) { - RString k = ""; - RString o = ""; + RString o = "X"; // I was thinking of using "C" to indicate chart.. however.. X is cooler... - Mina vector& nerv = nd.GetNonEmptyRowVector(); unsigned int numThreads = max(std::thread::hardware_concurrency(), 1u); @@ -502,7 +501,7 @@ RString Steps::GenerateChartKey(NoteData& nd, TimingData *td) size_t segmentSize = nerv.size() / numThreads; std::vector threads; threads.reserve(numThreads); - + for (unsigned int curThread = 0; curThread < numThreads; curThread++) { keyParts.push_back(""); @@ -519,12 +518,8 @@ RString Steps::GenerateChartKey(NoteData& nd, TimingData *td) if(t.joinable()) t.join(); } - - for(size_t i = 0; i < numThreads; i++) - k += keyParts[i]; - - o.append("X"); // I was thinking of using "C" to indicate chart.. however.. X is cooler... - Mina - o.append(BinaryToHex(CryptManager::GetSHA1ForString(k))); + + o.append(BinaryToHex(CryptManager::GetSHA1ForString(*keyParts.data()))); return o; }