diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-07-10 15:54:27 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-07-10 16:31:43 +0200 |
commit | f4d917600e4e87dc9ed1fa2d6140cd834d75ef25 (patch) | |
tree | 30d1faac5fdebfbdd96e079b34cd4d65a547b4b3 /src | |
parent | f2f999774832081afc225e4fa6483566d721ff0d (diff) | |
download | justbuild-f4d917600e4e87dc9ed1fa2d6140cd834d75ef25.tar.gz |
ArtifactDigest: add order
Diffstat (limited to 'src')
-rw-r--r-- | src/buildtool/common/artifact_digest.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/buildtool/common/artifact_digest.hpp b/src/buildtool/common/artifact_digest.hpp index ec3c65da..2ad94c27 100644 --- a/src/buildtool/common/artifact_digest.hpp +++ b/src/buildtool/common/artifact_digest.hpp @@ -90,6 +90,12 @@ class ArtifactDigest { } } + [[nodiscard]] auto operator<(ArtifactDigest const& other) const -> bool { + return (hash_ < other.hash_) or + ((hash_ == other.hash_) and (static_cast<int>(is_tree_) < + static_cast<int>(other.is_tree_))); + } + private: std::size_t size_{}; std::string hash_{}; |