diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-07-05 16:49:45 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-07-22 17:01:13 +0200 |
commit | beb3faa6956b9bfd58d4ea6644a9b2987409aaba (patch) | |
tree | 9a1edee40bfe335717eb856237372d50127367ac /src/buildtool/build_engine/expression/expression.cpp | |
parent | 30f2b4a215ebd4f9c0c491f41de6e8eb56ed3fdf (diff) | |
download | justbuild-beb3faa6956b9bfd58d4ea6644a9b2987409aaba.tar.gz |
Use HashFunction functionality via Instance()
...to track changes during refactoring easier.
Diffstat (limited to 'src/buildtool/build_engine/expression/expression.cpp')
-rw-r--r-- | src/buildtool/build_engine/expression/expression.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/buildtool/build_engine/expression/expression.cpp b/src/buildtool/build_engine/expression/expression.cpp index 643d4b31..e155f749 100644 --- a/src/buildtool/build_engine/expression/expression.cpp +++ b/src/buildtool/build_engine/expression/expression.cpp @@ -24,6 +24,8 @@ #include "fmt/core.h" #include "gsl/gsl" #include "src/buildtool/build_engine/expression/evaluator.hpp" +#include "src/buildtool/crypto/hash_function.hpp" +#include "src/buildtool/crypto/hasher.hpp" #include "src/buildtool/logging/logger.hpp" #include "src/utils/cpp/gsl.hpp" #include "src/utils/cpp/json.hpp" @@ -245,10 +247,11 @@ auto Expression::ComputeHash() const noexcept -> std::string { : IsNode() ? "#" : IsName() ? "$" : ""}; - hash = HashFunction::ComputeHash(prefix + ToString()).Bytes(); + hash = + HashFunction::Instance().ComputeHash(prefix + ToString()).Bytes(); } else { - auto hasher = HashFunction::Hasher(); + auto hasher = HashFunction::Instance().Hasher(); if (IsList()) { auto list = Value<Expression::list_t>(); hasher.Update("["); @@ -260,7 +263,8 @@ auto Expression::ComputeHash() const noexcept -> std::string { auto map = Value<Expression::map_t>(); hasher.Update("{"); for (auto const& el : map->get()) { - hasher.Update(HashFunction::ComputeHash(el.first).Bytes()); + hasher.Update( + HashFunction::Instance().ComputeHash(el.first).Bytes()); hasher.Update(el.second->ToHash()); } } |