diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2022-02-28 13:24:26 +0100 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2022-03-01 10:46:54 +0100 |
commit | 1ef03a1c7043d617885d319b0803d69907c3c9cc (patch) | |
tree | acfcd33dab8e2355863356af88d14ac6e3578b2d /src/buildtool/main/main.cpp | |
parent | fffee539ec37e9e68189e71994aa2c901d30c9fb (diff) | |
download | justbuild-1ef03a1c7043d617885d319b0803d69907c3c9cc.tar.gz |
Pass actions and trees in analysis result as shared pointer
... to avoid unnecessary copying and moving of larger objects.
Diffstat (limited to 'src/buildtool/main/main.cpp')
-rw-r--r-- | src/buildtool/main/main.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp index d1343ad5..eb555a8c 100644 --- a/src/buildtool/main/main.cpp +++ b/src/buildtool/main/main.cpp @@ -694,10 +694,11 @@ struct AnalysisResult { [[nodiscard]] auto TargetActionsToJson(AnalysedTargetPtr const& target) -> nlohmann::json { auto actions = nlohmann::json::array(); - std::for_each( - target->Actions().begin(), - target->Actions().end(), - [&actions](auto const& action) { actions.push_back(action.ToJson()); }); + std::for_each(target->Actions().begin(), + target->Actions().end(), + [&actions](auto const& action) { + actions.push_back(action->ToJson()); + }); return actions; } @@ -707,7 +708,7 @@ struct AnalysisResult { std::for_each( target->Trees().begin(), target->Trees().end(), - [&trees](auto const& tree) { trees[tree.Id()] = tree.ToJson(); }); + [&trees](auto const& tree) { trees[tree->Id()] = tree->ToJson(); }); return trees; } |