pre-initialize size of vectors for writing nps/notes per measure to cache file.

This commit is contained in:
Michael Votaw
2025-03-03 18:09:07 -06:00
committed by teejusb
parent c0db6beb9c
commit 239d38d5aa
2 changed files with 4 additions and 2 deletions
+2 -2
View File
@@ -447,7 +447,7 @@ static RString GetSSCNoteData( const Song &song, const Steps &in, bool bSavingCa
// The vast majority of charts don't, so there's no reason to store duplicated data.
const std::vector<std::vector<float>> &allNpsPerMeasures = in.GetAllNpsPerMeasures();
std::vector<RString> npsPerMeasureStrings;
npsPerMeasureStrings.reserve(allNpsPerMeasures.size());
for(std::vector<float> npsPerMeasure : allNpsPerMeasures)
{
npsPerMeasureStrings.push_back(serialize(npsPerMeasure, ",", 3));
@@ -457,7 +457,7 @@ static RString GetSSCNoteData( const Song &song, const Steps &in, bool bSavingCa
const std::vector<std::vector<int>> &allNotesPerMeasures = in.GetAllNotesPerMeasures();
std::vector<RString> notesPerMeasureStrings;
notesPerMeasureStrings.reserve(allNotesPerMeasures.size());
for(std::vector<int> notesPerMeasure : allNotesPerMeasures)
{
notesPerMeasureStrings.push_back(serialize(notesPerMeasure, ","));