From 93d7d9c4170fc589b12850f4ef65513b19a8986a Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Wed, 15 Apr 2026 13:46:13 +0100 Subject: [PATCH] Optimize DfgDataType::hash() --- src/V3DfgDataType.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/V3DfgDataType.h b/src/V3DfgDataType.h index 729b4c0b9..5af232b84 100644 --- a/src/V3DfgDataType.h +++ b/src/V3DfgDataType.h @@ -125,6 +125,8 @@ public: // Thanks to the interning, equality is identity bool operator==(const DfgDataType& that) const { return this == &that; } bool operator!=(const DfgDataType& that) const { return this != &that; } + // Similarly for hash + V3Hash hash() const { return V3Hash{this}; } // Type of elements, for arrays only const DfgDataType& elemDtype() const { @@ -132,13 +134,6 @@ public: return *m_elemDtypep; } - V3Hash hash() const { - V3Hash hash{static_cast(m_kind)}; - hash += m_size; - if (m_elemDtypep) hash += m_elemDtypep->hash(); - return hash; - } - //----------------------------------------------------------------------- // Static factory and management functions