diff options
Diffstat (limited to 'src/buildtool/crypto/hash_function.cpp')
-rw-r--r-- | src/buildtool/crypto/hash_function.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/buildtool/crypto/hash_function.cpp b/src/buildtool/crypto/hash_function.cpp index 02e43f1f..d1ca0c2b 100644 --- a/src/buildtool/crypto/hash_function.cpp +++ b/src/buildtool/crypto/hash_function.cpp @@ -16,20 +16,19 @@ #include <cstddef> #include <fstream> -#include <string> #include "src/buildtool/logging/log_level.hpp" #include "src/buildtool/logging/logger.hpp" [[nodiscard]] auto HashFunction::ComputeHashFile( const std::filesystem::path& file_path, - bool as_tree) noexcept + bool as_tree) const noexcept -> std::optional<std::pair<Hasher::HashDigest, std::uintmax_t>> { static constexpr std::size_t kChunkSize{4048}; try { auto hasher = Hasher(); auto size = std::filesystem::file_size(file_path); - if (HashType() == JustHash::Native) { + if (type_ == JustHash::Native) { hasher.Update( (as_tree ? std::string{"tree "} : std::string{"blob "}) + std::to_string(size) + '\0'); |