From c4783953004ce5a8426e8eff94ac653a28c358b1 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Mon, 8 Jul 2024 14:07:12 +0200 Subject: Capture in TreeReaders by pointer to avoid temporaries --- src/buildtool/execution_api/local/local_api.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/buildtool/execution_api/local/local_api.hpp') 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{storage_.CAS()}; + auto reader = TreeReader{&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 const& artifacts_info, std::vector const& fds, bool raw_tree) const noexcept -> bool final { - auto dumper = StreamDumper{storage_.CAS()}; + auto dumper = StreamDumper{&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{storage_.CAS()}; + auto reader = TreeReader{&storage_.CAS()}; auto const& result = reader.ReadDirectTreeEntries( info.digest, std::filesystem::path{}); if (not result or not RetrieveToCas(result->infos, api)) { -- cgit v1.2.3