From 1ef03a1c7043d617885d319b0803d69907c3c9cc Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Mon, 28 Feb 2022 13:24:26 +0100 Subject: Pass actions and trees in analysis result as shared pointer ... to avoid unnecessary copying and moving of larger objects. --- src/buildtool/build_engine/target_map/target_map.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/buildtool/build_engine/target_map/target_map.cpp') diff --git a/src/buildtool/build_engine/target_map/target_map.cpp b/src/buildtool/build_engine/target_map/target_map.cpp index 327dbe02..159669b7 100644 --- a/src/buildtool/build_engine/target_map/target_map.cpp +++ b/src/buildtool/build_engine/target_map/target_map.cpp @@ -302,9 +302,9 @@ void withDependencies( // Evaluate main expression auto expression_config = key.config.Prune(config_vars); - std::vector actions{}; + std::vector actions{}; std::vector blobs{}; - std::vector trees{}; + std::vector trees{}; auto main_exp_fcts = FunctionMap::MakePtr( {{"FIELD", [¶ms](auto&& eval, auto const& expr, auto const& env) { @@ -496,7 +496,7 @@ void withDependencies( may_fail, no_cache, inputs_exp); - auto action_id = action.Id(); + auto action_id = action->Id(); actions.emplace_back(std::move(action)); for (auto const& out : outputs) { result.emplace(out, @@ -566,8 +566,8 @@ void withDependencies( throw Evaluator::EvaluationError{ fmt::format("TREE conflicts on subtree {}", *conflict)}; } - auto tree = Tree{std::move(artifacts)}; - auto tree_id = tree.Id(); + auto tree = std::make_shared(std::move(artifacts)); + auto tree_id = tree->Id(); trees.emplace_back(std::move(tree)); return ExpressionPtr{ArtifactDescription{tree_id}}; }}, -- cgit v1.2.3