summaryrefslogtreecommitdiff
path: root/src/core/hle
diff options
context:
space:
mode:
authorGravatar bunnei2018-08-09 19:29:36 -0400
committerGravatar GitHub2018-08-09 19:29:36 -0400
commit69cd213fac6b60dd044ec5598336c5b6cb201440 (patch)
tree121dadb00f25d4bea8f7c04c79b8aef4bc411b7b /src/core/hle
parentMerge pull request #1001 from lioncash/reserve (diff)
parentfsp_srv: Use std::string_view's copy() function instead of strncpy() (diff)
downloadyuzu-69cd213fac6b60dd044ec5598336c5b6cb201440.tar.gz
yuzu-69cd213fac6b60dd044ec5598336c5b6cb201440.tar.xz
yuzu-69cd213fac6b60dd044ec5598336c5b6cb201440.zip
Merge pull request #990 from lioncash/entry
fsp_srv: Emplace entries first when building index instead of emplacing last
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/service/filesystem/fsp_srv.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp
index e7ffb6bd1..1470f9017 100644
--- a/src/core/hle/service/filesystem/fsp_srv.cpp
+++ b/src/core/hle/service/filesystem/fsp_srv.cpp
@@ -193,13 +193,10 @@ private:
193template <typename T> 193template <typename T>
194static void BuildEntryIndex(std::vector<FileSys::Entry>& entries, const std::vector<T>& new_data, 194static void BuildEntryIndex(std::vector<FileSys::Entry>& entries, const std::vector<T>& new_data,
195 FileSys::EntryType type) { 195 FileSys::EntryType type) {
196 entries.reserve(entries.size() + new_data.size());
197
196 for (const auto& new_entry : new_data) { 198 for (const auto& new_entry : new_data) {
197 FileSys::Entry entry; 199 entries.emplace_back(new_entry->GetName(), type, new_entry->GetSize());
198 entry.filename[0] = '\0';
199 std::strncat(entry.filename, new_entry->GetName().c_str(), FileSys::FILENAME_LENGTH - 1);
200 entry.type = type;
201 entry.file_size = new_entry->GetSize();
202 entries.emplace_back(std::move(entry));
203 } 200 }
204} 201}
205 202