From 27261f670397e114520ab8778b7ff8043ab307a1 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 7 Jun 2022 11:02:18 +0200 Subject: [PATCH] Remove hash functions. --- libsolutil/LP.h | 52 ------------------------------------------------- 1 file changed, 52 deletions(-) diff --git a/libsolutil/LP.h b/libsolutil/LP.h index 244235f5b..aec7978b2 100644 --- a/libsolutil/LP.h +++ b/libsolutil/LP.h @@ -139,58 +139,6 @@ struct RationalWithDelta } -template -inline void hashCombine(std::size_t& _seed, T const& _v) -{ - std::hash hasher; - _seed ^= hasher(_v) + 0x9e3779b9 + (_seed << 6) + (_seed >> 2); -} - -template -inline void hashCombineVector(std::size_t& _seed, std::vector const& _v) -{ - hashCombine(_seed, _v.size()); - for (auto const& x: _v) - hashCombine(_seed, x); -} - -template<> -struct std::hash -{ - std::size_t operator()(solidity::util::RationalWithDelta const& _x) const noexcept - { - std::size_t result = 0; - hashCombine(result, _x.m_main); - hashCombine(result, _x.m_delta); - return result; - } -}; - -template<> -struct std::hash -{ - std::size_t operator()(solidity::util::LinearExpression const& _linearExpression) const noexcept - { - std::size_t result = 0; - hashCombine(result, _linearExpression.size()); - for (auto const& x: _linearExpression.enumerate()) - hashCombine(result, x.second); - return result; - } -}; - -template<> -struct std::hash -{ - std::size_t operator()(solidity::util::Constraint const& _constraint) const noexcept - { - std::size_t result = 0; - hashCombine(result, _constraint.kind); - hashCombine(result, _constraint.data); - return result; - } -}; - namespace solidity::util {