summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api/remote/bazel/bazel_api.cpp
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-05-27 16:16:26 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-05-28 16:19:19 +0200
commitc0b46b2f4e47fc017beeae34ff555418d198e1d4 (patch)
tree6a4319a1b974fd6113fab80dd1047c1a8cb7be18 /src/buildtool/execution_api/remote/bazel/bazel_api.cpp
parentfd8ad0f561dd253bf7399ce9a4594242e918ca25 (diff)
downloadjustbuild-c0b46b2f4e47fc017beeae34ff555418d198e1d4.tar.gz
Use shared_ptr for data in ContentBlob
...to reduce the "price" of copying.
Diffstat (limited to 'src/buildtool/execution_api/remote/bazel/bazel_api.cpp')
-rw-r--r--src/buildtool/execution_api/remote/bazel/bazel_api.cpp6
1 files changed, 3 insertions, 3 deletions
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</*kSetEpochTime=*/true,
/*kSetWritable=*/true>(
- 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<std::string> {
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();
}