summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-09-16 15:29:27 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-09-18 09:45:19 +0200
commit2669a27e7322772ff366662ccc5e9f02cedf70bd (patch)
tree6439626c788d8df01a5049310f57cc3a74dcf678 /src
parent59a0ce6d9df4465f2a7e6cbeb78a339f30574ae6 (diff)
downloadjustbuild-2669a27e7322772ff366662ccc5e9f02cedf70bd.tar.gz
Remove a redundant string allocation.
Diffstat (limited to 'src')
-rw-r--r--src/buildtool/execution_api/remote/bazel/bytestream_client.hpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/buildtool/execution_api/remote/bazel/bytestream_client.hpp b/src/buildtool/execution_api/remote/bazel/bytestream_client.hpp
index 88abe6fd..04f88dda 100644
--- a/src/buildtool/execution_api/remote/bazel/bytestream_client.hpp
+++ b/src/buildtool/execution_api/remote/bazel/bytestream_client.hpp
@@ -115,11 +115,9 @@ class ByteStreamClient {
google::bytestream::WriteResponse response{};
auto writer = stub_->Write(&ctx, &response);
- auto* allocated_data =
- std::make_unique<std::string>(kChunkSize, '\0').release();
google::bytestream::WriteRequest request{};
request.set_resource_name(resource_name);
- request.set_allocated_data(allocated_data);
+ request.mutable_data()->resize(kChunkSize, '\0');
std::size_t pos{};
do {