perf(files): move directory-entry names instead of copying them (#758)

This commit is contained in:
crevant
2026-09-22 10:26:06 +02:00
committed by GitHub
parent 8dc9b9d532
commit 8b095caefe
+2 -7
View File
@@ -453,13 +453,8 @@ std::vector<File::DirEntry> File::GetDirEntries(const std::filesystem::path& pat
std::vector<File::DirEntry> ret;
ret.reserve(files.size());
for (const auto& f: files) {
File::DirEntry r {};
r.name = f.name;
r.is_file = f.is_file;
ret.push_back(std::move(r));
for (auto& f: files) {
ret.emplace_back(std::move(f.name), f.is_file);
}
return ret;