From cc6cb455362969c76f15df189183f5da5fe7e54a Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 21 Jul 2018 22:31:41 -0400 Subject: [PATCH] file_util: std::move FST entries in ScanDirectoryTree() Avoids unnecessary copies when building up the FST entries. --- src/common/file_util.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index ac32a1fc6f..5b1d66daa3 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp @@ -478,7 +478,7 @@ unsigned ScanDirectoryTree(const std::string& directory, FSTEntry& parent_entry, (*num_entries_out)++; // Push into the tree - parent_entry.children.push_back(entry); + parent_entry.children.push_back(std::move(entry)); return true; };