VERY experimental Nintendo Switch 2 emulator
C++
fsp_srv: Emplace entries first when building index instead of emplacing last
Lioncasha1320c53af87
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cppindex e7ffb6bd16..4110e67b47 100644--- a/src/core/hle/service/filesystem/fsp_srv.cpp+++ b/src/core/hle/service/filesystem/fsp_srv.cpp@@ -193,13 +193,14 @@ private:template <typename T>static void BuildEntryIndex(std::vector<FileSys::Entry>& entries, const std::vector<T>& new_data,FileSys::EntryType type) {+ entries.reserve(entries.size() + new_data.size());+for (const auto& new_entry : new_data) {- FileSys::Entry entry;+ auto& entry = entries.emplace_back();entry.filename[0] = '\0';std::strncat(entry.filename, new_entry->GetName().c_str(), FileSys::FILENAME_LENGTH - 1);entry.type = type;entry.file_size = new_entry->GetSize();- entries.emplace_back(std::move(entry));}}