diff options
Diffstat (limited to 'source/slang/slang-ast-builder.cpp')
| -rw-r--r-- | source/slang/slang-ast-builder.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/slang/slang-ast-builder.cpp b/source/slang/slang-ast-builder.cpp index 33bd23f43..e6e1b5e75 100644 --- a/source/slang/slang-ast-builder.cpp +++ b/source/slang/slang-ast-builder.cpp @@ -445,6 +445,7 @@ TypeType* ASTBuilder::getTypeType(Type* type) bool ASTBuilder::NodeDesc::operator==(NodeDesc const& that) const { + if (hashCode != that.hashCode) return false; if(type != that.type) return false; if(operands.getCount() != that.operands.getCount()) return false; for(Index i = 0; i < operands.getCount(); ++i) @@ -461,7 +462,8 @@ bool ASTBuilder::NodeDesc::operator==(NodeDesc const& that) const } return true; } -HashCode ASTBuilder::NodeDesc::getHashCode() const + +void ASTBuilder::NodeDesc::init() { Hasher hasher; hasher.hashValue(Int(type)); @@ -474,7 +476,7 @@ HashCode ASTBuilder::NodeDesc::getHashCode() const // hasher.hashValue(operands[i].values.nodeOperand); } - return hasher.getResult(); + hashCode = hasher.getResult(); } DeclRef<Decl> _getSpecializedDeclRef(ASTBuilder* builder, Decl* decl, Substitutions* subst) |
