mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-28 13:56:59 +01:00
perf(files): move directory-entry names instead of copying them (#758)
This commit is contained in:
+2
-7
@@ -453,13 +453,8 @@ std::vector<File::DirEntry> File::GetDirEntries(const std::filesystem::path& pat
|
|||||||
std::vector<File::DirEntry> ret;
|
std::vector<File::DirEntry> ret;
|
||||||
ret.reserve(files.size());
|
ret.reserve(files.size());
|
||||||
|
|
||||||
for (const auto& f: files) {
|
for (auto& f: files) {
|
||||||
File::DirEntry r {};
|
ret.emplace_back(std::move(f.name), f.is_file);
|
||||||
|
|
||||||
r.name = f.name;
|
|
||||||
r.is_file = f.is_file;
|
|
||||||
|
|
||||||
ret.push_back(std::move(r));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
Reference in New Issue
Block a user