diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-08-29 11:55:07 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-08-30 17:17:09 +0200 |
commit | 3a771602f8ee6c7940208d447463061aa9b6af8c (patch) | |
tree | 491e86926da47d9365a49a3ecdd35dbcd48c1364 /src/buildtool/execution_api/local/local_api.hpp | |
parent | 60daf819bbe7db97064c7e102acedbf3cd693410 (diff) | |
download | justbuild-3a771602f8ee6c7940208d447463061aa9b6af8c.tar.gz |
Return the IsTree flag from ArtifactDigest
...and replace obvious redundant conversions to bazel_re::Digest, which were done to ensure that the digest represents a tree.
Diffstat (limited to 'src/buildtool/execution_api/local/local_api.hpp')
-rw-r--r-- | src/buildtool/execution_api/local/local_api.hpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/buildtool/execution_api/local/local_api.hpp b/src/buildtool/execution_api/local/local_api.hpp index eadf45b7..59dc1880 100644 --- a/src/buildtool/execution_api/local/local_api.hpp +++ b/src/buildtool/execution_api/local/local_api.hpp @@ -33,7 +33,6 @@ #include "src/buildtool/common/artifact_digest.hpp" #include "src/buildtool/common/repository_config.hpp" #include "src/buildtool/compatibility/compatibility.hpp" -#include "src/buildtool/compatibility/native_support.hpp" #include "src/buildtool/execution_api/bazel_msg/bazel_blob_container.hpp" #include "src/buildtool/execution_api/common/artifact_blob_container.hpp" #include "src/buildtool/execution_api/common/blob_tree.hpp" @@ -262,8 +261,7 @@ class LocalApi final : public IExecutionApi { bool /*skip_find_missing*/) const noexcept -> bool final { for (auto const& blob : blobs.Blobs()) { - auto const is_tree = NativeSupport::IsTree( - static_cast<bazel_re::Digest>(blob.digest).hash()); + auto const is_tree = blob.digest.IsTree(); auto cas_digest = is_tree ? local_context_.storage->CAS().StoreTree(*blob.data) : local_context_.storage->CAS().StoreBlob(*blob.data, @@ -308,7 +306,7 @@ class LocalApi final : public IExecutionApi { [[nodiscard]] auto IsAvailable(ArtifactDigest const& digest) const noexcept -> bool final { return static_cast<bool>( - NativeSupport::IsTree(static_cast<bazel_re::Digest>(digest).hash()) + digest.IsTree() ? local_context_.storage->CAS().TreePath(digest) : local_context_.storage->CAS().BlobPath(digest, false)); } @@ -317,9 +315,8 @@ class LocalApi final : public IExecutionApi { const noexcept -> std::vector<ArtifactDigest> final { std::vector<ArtifactDigest> result; for (auto const& digest : digests) { - auto const& path = - NativeSupport::IsTree( - static_cast<bazel_re::Digest>(digest).hash()) + auto const path = + digest.IsTree() ? local_context_.storage->CAS().TreePath(digest) : local_context_.storage->CAS().BlobPath(digest, false); if (not path) { |