From 8b095caefecc2b0066b1b66425d24fd90f29a609 Mon Sep 17 00:00:00 2001 From: crevant <196562377+crevant@users.noreply.github.com> Date: Tue, 22 Sep 2026 10:26:06 +0200 Subject: [PATCH] perf(files): move directory-entry names instead of copying them (#758) --- src/common/file.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/common/file.cpp b/src/common/file.cpp index 0f0cda73f..3766a0907 100644 --- a/src/common/file.cpp +++ b/src/common/file.cpp @@ -453,13 +453,8 @@ std::vector File::GetDirEntries(const std::filesystem::path& pat std::vector 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;