diff options
author | Alberto Sartori <alberto.sartori@huawei.com> | 2025-04-17 11:20:50 +0200 |
---|---|---|
committer | Alberto Sartori <alberto.sartori@huawei.com> | 2025-04-17 13:20:31 +0200 |
commit | 7a835652d1bf73706678f60d6b6c86d3da3ecbd8 (patch) | |
tree | 7fd9bb97765197bcfda940eb02e1a9b7c5ac783d /src/buildtool/execution_api | |
parent | ad0bd0af0962548821a83a9582d96d959f56bae3 (diff) | |
download | justbuild-7a835652d1bf73706678f60d6b6c86d3da3ecbd8.tar.gz |
bazel_execution_client: eliminate one un-needed copy
Diffstat (limited to 'src/buildtool/execution_api')
-rw-r--r-- | src/buildtool/execution_api/remote/bazel/bazel_execution_client.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/buildtool/execution_api/remote/bazel/bazel_execution_client.cpp b/src/buildtool/execution_api/remote/bazel/bazel_execution_client.cpp index 22e96de1..eb0cd23c 100644 --- a/src/buildtool/execution_api/remote/bazel/bazel_execution_client.cpp +++ b/src/buildtool/execution_api/remote/bazel/bazel_execution_client.cpp @@ -212,27 +212,26 @@ auto BazelExecutionClient::ExtractContents( // Error was already logged in ReadExecution() return {ExecutionResponse::MakeEmptyFailed(), std::nullopt}; } - auto op = *operation; ExecutionResponse response; - response.execution_handle = op.name(); - if (not op.done()) { + response.execution_handle = operation->name(); + if (not operation->done()) { response.state = ExecutionResponse::State::Ongoing; return {response, std::nullopt}; } - if (op.has_error()) { - LogStatus(&logger_, LogLevel::Debug, op.error()); - if (op.error().code() == grpc::StatusCode::UNAVAILABLE) { + if (operation->has_error()) { + LogStatus(&logger_, LogLevel::Debug, operation->error()); + if (operation->error().code() == grpc::StatusCode::UNAVAILABLE) { response.state = ExecutionResponse::State::Retry; } else { response.state = ExecutionResponse::State::Failed; } - return {response, op.error().ShortDebugString()}; + return {response, operation->error().ShortDebugString()}; } // Get execution response Unpacked from Protobufs Any type to the actual // type in our case - auto const& raw_response = op.response(); + auto const& raw_response = operation->response(); if (not raw_response.Is<bazel_re::ExecuteResponse>()) { // Fatal error, the type should be correct logger_.Emit(LogLevel::Error, "Corrupted ExecuteResponse"); |