diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-07-08 14:07:12 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-07-12 15:43:37 +0200 |
commit | c4783953004ce5a8426e8eff94ac653a28c358b1 (patch) | |
tree | f91775f64650bf212c72257c2b6b40a8ba721660 /src/buildtool/execution_api/local/local_api.hpp | |
parent | 547aa358600c2d65307cf3516d88b3bc037b46aa (diff) | |
download | justbuild-c4783953004ce5a8426e8eff94ac653a28c358b1.tar.gz |
Capture in TreeReaders by pointer to avoid temporaries
Diffstat (limited to 'src/buildtool/execution_api/local/local_api.hpp')
-rw-r--r-- | src/buildtool/execution_api/local/local_api.hpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/buildtool/execution_api/local/local_api.hpp b/src/buildtool/execution_api/local/local_api.hpp index 6f43dd44..bfa1d6c6 100644 --- a/src/buildtool/execution_api/local/local_api.hpp +++ b/src/buildtool/execution_api/local/local_api.hpp @@ -95,7 +95,7 @@ class LocalApi final : public IExecutionApi { auto const& info = artifacts_info[i]; if (IsTreeObject(info.type)) { // read object infos from sub tree and call retrieve recursively - auto reader = TreeReader<LocalCasReader>{storage_.CAS()}; + auto reader = TreeReader<LocalCasReader>{&storage_.CAS()}; auto const result = reader.RecursivelyReadTreeLeafs( info.digest, output_paths[i]); if (not result) { @@ -149,7 +149,7 @@ class LocalApi final : public IExecutionApi { std::vector<Artifact::ObjectInfo> const& artifacts_info, std::vector<int> const& fds, bool raw_tree) const noexcept -> bool final { - auto dumper = StreamDumper<LocalCasReader>{storage_.CAS()}; + auto dumper = StreamDumper<LocalCasReader>{&storage_.CAS()}; return CommonRetrieveToFds( artifacts_info, fds, @@ -202,7 +202,7 @@ class LocalApi final : public IExecutionApi { auto const& info = missing_artifacts_info->back_map[dgst]; // Recursively process trees. if (IsTreeObject(info.type)) { - auto reader = TreeReader<LocalCasReader>{storage_.CAS()}; + auto reader = TreeReader<LocalCasReader>{&storage_.CAS()}; auto const& result = reader.ReadDirectTreeEntries( info.digest, std::filesystem::path{}); if (not result or not RetrieveToCas(result->infos, api)) { |