From c0b46b2f4e47fc017beeae34ff555418d198e1d4 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Mon, 27 May 2024 16:16:26 +0200 Subject: Use shared_ptr for data in ContentBlob ...to reduce the "price" of copying. --- src/buildtool/execution_api/remote/bazel/bazel_api.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/buildtool/execution_api/remote/bazel/bazel_api.cpp') diff --git a/src/buildtool/execution_api/remote/bazel/bazel_api.cpp b/src/buildtool/execution_api/remote/bazel/bazel_api.cpp index e56228eb..00f7308c 100644 --- a/src/buildtool/execution_api/remote/bazel/bazel_api.cpp +++ b/src/buildtool/execution_api/remote/bazel/bazel_api.cpp @@ -275,7 +275,7 @@ auto BazelApi::CreateAction( auto const& type = artifacts_info[gpos].type; if (not FileSystemManager::WriteFileAs( - blobs[pos].data, output_paths[gpos], type)) { + *blobs[pos].data, output_paths[gpos], type)) { Logger::Log(LogLevel::Warning, "staging to output path {} failed.", output_paths[gpos].string()); @@ -432,7 +432,7 @@ auto BazelApi::CreateAction( -> std::optional { auto blobs = network_->ReadBlobs({artifact_info.digest}).Next(); if (blobs.size() == 1) { - return blobs.at(0).data; + return *blobs.at(0).data; } return std::nullopt; } @@ -465,7 +465,7 @@ auto BazelApi::CreateAction( targets->reserve(digests.size()); while (not blobs.empty()) { for (auto const& blob : blobs) { - targets->emplace_back(blob.data); + targets->emplace_back(*blob.data); } blobs = reader.Next(); } -- cgit v1.2.3