From c01123bd19be5398f20730d2872ad337e5b5d73a Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Thu, 29 Aug 2024 17:31:02 +0200 Subject: Cast ArtifactDigest to bazel_re::Digest explicitly ...to simplify further refactoring. --- .../execution_api/execution_service/cas_server.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/buildtool/execution_api/execution_service/cas_server.cpp') diff --git a/src/buildtool/execution_api/execution_service/cas_server.cpp b/src/buildtool/execution_api/execution_service/cas_server.cpp index 2c2260ac..841243fc 100644 --- a/src/buildtool/execution_api/execution_service/cas_server.cpp +++ b/src/buildtool/execution_api/execution_service/cas_server.cpp @@ -60,14 +60,14 @@ inline constexpr std::size_t kSHA256Length = 64; } [[nodiscard]] auto CheckDigestConsistency( - bazel_re::Digest const& ref, - bazel_re::Digest const& computed) noexcept -> std::optional { + ArtifactDigest const& ref, + ArtifactDigest const& computed) noexcept -> std::optional { bool valid = ref.hash() == computed.hash(); if (valid) { bool const check_sizes = - Compatibility::IsCompatible() or ref.size_bytes() != 0; + Compatibility::IsCompatible() or ref.size() != 0; if (check_sizes) { - valid = ref.size_bytes() == computed.size_bytes(); + valid = ref.size() == computed.size(); } } if (not valid) { @@ -76,9 +76,9 @@ inline constexpr std::size_t kSHA256Length = 64; "from data {}:{} do not correspond.", ref.hash(), ref.hash(), - ref.size_bytes(), + ref.size(), computed.hash(), - computed.size_bytes()); + computed.size()); } return std::nullopt; } @@ -373,6 +373,7 @@ auto CASServiceImpl::SpliceBlob(::grpc::ServerContext* /*context*/, return ::grpc::Status{grpc::StatusCode::INVALID_ARGUMENT, str}; } - response->mutable_blob_digest()->CopyFrom(*splice_result); + (*response->mutable_blob_digest()) = + static_cast(*splice_result); return ::grpc::Status::OK; } -- cgit v1.2.3