summaryrefslogtreecommitdiff
path: root/src/other_tools/utils
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-07-17 12:57:28 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-07-22 17:02:34 +0200
commitb2f51059cc034f03c70df28a5597a591ed3e5c5d (patch)
treefa607f601f623f70a05aabc18801c6daed4c2a18 /src/other_tools/utils
parent0b80611163ffedb87dc2305320906f27e502cbcd (diff)
downloadjustbuild-b2f51059cc034f03c70df28a5597a591ed3e5c5d.tar.gz
Create Hasher using a static function
Diffstat (limited to 'src/other_tools/utils')
-rw-r--r--src/other_tools/utils/content.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/other_tools/utils/content.hpp b/src/other_tools/utils/content.hpp
index 31dd7fc1..eb6aca76 100644
--- a/src/other_tools/utils/content.hpp
+++ b/src/other_tools/utils/content.hpp
@@ -89,9 +89,9 @@
template <Hasher::HashType type>
[[nodiscard]] static auto GetContentHash(std::string const& data) noexcept
-> std::string {
- Hasher hasher{type};
- hasher.Update(data);
- auto digest = std::move(hasher).Finalize();
+ auto hasher = Hasher::Create(type);
+ hasher->Update(data);
+ auto digest = std::move(*hasher).Finalize();
return digest.HexString();
}