summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-08-08 23:39:00 +0200
committerLioncash <mathew1800@gmail.com>2018-08-09 00:51:41 +0200
commit4afb05d0cc35f36ea145768f052755554d9494fc (patch)
tree92e2c1c71a023514670903f7219740333808fc41 /src/core/hle/service
parentMerge pull request #966 from lioncash/modernize (diff)
downloadyuzu-4afb05d0cc35f36ea145768f052755554d9494fc.tar
yuzu-4afb05d0cc35f36ea145768f052755554d9494fc.tar.gz
yuzu-4afb05d0cc35f36ea145768f052755554d9494fc.tar.bz2
yuzu-4afb05d0cc35f36ea145768f052755554d9494fc.tar.lz
yuzu-4afb05d0cc35f36ea145768f052755554d9494fc.tar.xz
yuzu-4afb05d0cc35f36ea145768f052755554d9494fc.tar.zst
yuzu-4afb05d0cc35f36ea145768f052755554d9494fc.zip
Diffstat (limited to 'src/core/hle/service')
-rw-r--r--src/core/hle/service/filesystem/fsp_srv.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp
index e7ffb6bd1..4110e67b4 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));
}
}