Optimize DfgDataType::hash()
This commit is contained in:
parent
935b2564eb
commit
93d7d9c417
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue