From 50bcabb0717dae7c8411db59115c41b7cc636cb3 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Wed, 28 Aug 2024 14:43:23 +0200 Subject: Replace ArtifactDigest::CreateFromFile ...with ArtifactDigestFactory::HashFileAs --- src/buildtool/common/artifact_digest.hpp | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'src/buildtool/common/artifact_digest.hpp') diff --git a/src/buildtool/common/artifact_digest.hpp b/src/buildtool/common/artifact_digest.hpp index ebd01ceb..24097776 100644 --- a/src/buildtool/common/artifact_digest.hpp +++ b/src/buildtool/common/artifact_digest.hpp @@ -96,21 +96,6 @@ class ArtifactDigest final { } } - template - [[nodiscard]] static auto CreateFromFile( - HashFunction hash_function, - std::filesystem::path const& path) noexcept - -> std::optional { - static constexpr bool kIsTree = IsTreeObject(kType); - auto const hash = kIsTree ? hash_function.HashTreeFile(path) - : hash_function.HashBlobFile(path); - if (hash) { - return ArtifactDigest{ - hash->first.HexString(), hash->second, kIsTree}; - } - return std::nullopt; - } - private: std::size_t size_{}; std::string hash_{}; -- cgit v1.2.3