Optimize DfgDataType::hash()

This commit is contained in:
Geza Lore 2026-04-15 13:46:13 +01:00
parent 935b2564eb
commit 93d7d9c417
1 changed files with 2 additions and 7 deletions

View File

@ -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<uint32_t>(m_kind)};
hash += m_size;
if (m_elemDtypep) hash += m_elemDtypep->hash();
return hash;
}
//-----------------------------------------------------------------------
// Static factory and management functions