From 2669a27e7322772ff366662ccc5e9f02cedf70bd Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Mon, 16 Sep 2024 15:29:27 +0200 Subject: Remove a redundant string allocation. --- src/buildtool/execution_api/remote/bazel/bytestream_client.hpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') 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(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 { -- cgit v1.2.3