From beb3faa6956b9bfd58d4ea6644a9b2987409aaba Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Fri, 5 Jul 2024 16:49:45 +0200 Subject: Use HashFunction functionality via Instance() ...to track changes during refactoring easier. --- src/buildtool/crypto/hash_function.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/buildtool/crypto/hash_function.cpp') 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 #include -#include #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> { 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'); -- cgit v1.2.3