package org.simantics.scl.compiler.internal.elaboration.transformations;
-import gnu.trove.map.hash.THashMap;
-import gnu.trove.set.hash.THashSet;
-
import java.util.ArrayList;
import org.simantics.scl.compiler.common.exceptions.InternalCompilerError;
import org.simantics.scl.compiler.elaboration.modules.SCLValue;
import org.simantics.scl.compiler.errors.Locations;
import org.simantics.scl.compiler.internal.codegen.references.IVal;
-import org.simantics.scl.compiler.internal.types.TypeHashCodeContext;
+import org.simantics.scl.compiler.internal.types.HashCodeUtils;
import org.simantics.scl.compiler.types.TCon;
import org.simantics.scl.compiler.types.Type;
import org.simantics.scl.compiler.types.Types;
import org.simantics.scl.compiler.types.util.MultiApply;
import org.simantics.scl.compiler.types.util.MultiFunction;
+import gnu.trove.map.hash.THashMap;
+import gnu.trove.set.hash.THashSet;
+
public class UnifiableFactory {
private static final TCon Unifiable = Types.con("Unification", "Unifiable");
private static final Name uVar = Name.create("Unification", "uVar");
@Override
public int hashCode() {
if(hashCode == 0) {
- TypeHashCodeContext hcContext = new TypeHashCodeContext();
- hcContext.append(function.hashCode());
+ int hash = HashCodeUtils.SEED;
+ hash = HashCodeUtils.update(hash, function.hashCode());
for(Type typeParameter : typeParameters)
- typeParameter.updateHashCode(hcContext);
- hashCode = hcContext.getResult();
+ hash = typeParameter.hashCode(hash);
+ hashCode = hash;
}
return hashCode;
}