summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api/common/tree_reader.hpp
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-09-16 11:19:11 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-09-18 16:47:40 +0200
commit10d97aee7d2cdf4c5ea425491786fe9e59360299 (patch)
tree8a97ea8870815ab542bd636896e6f4819813b85f /src/buildtool/execution_api/common/tree_reader.hpp
parent1d748c1808e17998b4183574e3706ef1f7b6a5db (diff)
downloadjustbuild-10d97aee7d2cdf4c5ea425491786fe9e59360299.tar.gz
TreeReaderUtils: change InfoStoreFunc interface
...passing constructed Artifact::ObjectInfo by rvalue, to avoid additional copies.
Diffstat (limited to 'src/buildtool/execution_api/common/tree_reader.hpp')
-rw-r--r--src/buildtool/execution_api/common/tree_reader.hpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/buildtool/execution_api/common/tree_reader.hpp b/src/buildtool/execution_api/common/tree_reader.hpp
index de1e2edf..857573df 100644
--- a/src/buildtool/execution_api/common/tree_reader.hpp
+++ b/src/buildtool/execution_api/common/tree_reader.hpp
@@ -53,9 +53,9 @@ class TreeReader final {
TreeReaderUtils::InfoStoreFunc store_info =
[&result, &parent](std::filesystem::path const& path,
- Artifact::ObjectInfo const& info) {
+ Artifact::ObjectInfo&& info) {
result.paths.emplace_back(parent / path);
- result.infos.emplace_back(info);
+ result.infos.emplace_back(std::move(info));
return true;
};
@@ -125,11 +125,11 @@ class TreeReader final {
TreeReaderUtils::InfoStoreFunc internal_store =
[this, &store, &parent, include_trees](
std::filesystem::path const& path,
- Artifact::ObjectInfo const& info) -> bool {
+ Artifact::ObjectInfo&& info) -> bool {
return IsTreeObject(info.type)
? ReadObjectInfosRecursively(
store, parent / path, info.digest, include_trees)
- : store(parent / path, info);
+ : store(parent / path, std::move(info));
};
if (not impl_.IsNativeProtocol()) {