3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00

Consistent Sort#equals

This commit is contained in:
George Karpenkov 2016-01-06 11:16:45 +01:00
parent a816b4895c
commit d0d7a5b712

View file

@ -33,20 +33,17 @@ public class Sort extends AST
@Override
public boolean equals(Object o)
{
Sort casted = null;
if (o == null) return false;
if (o == this) return true;
if (o.getClass() != this.getClass()) return false;
Sort other = (Sort) o;
try {
casted = Sort.class.cast(o);
} catch (ClassCastException e) {
return false;
}
return
(this == casted) ||
(this != null) &&
(casted != null) &&
(getContext().nCtx() == casted.getContext().nCtx()) &&
(Native.isEqSort(getContext().nCtx(), getNativeObject(), casted.getNativeObject()));
return (getContext().nCtx() == other.getContext().nCtx()) &&
(Native.isEqSort(
getContext().nCtx(),
getNativeObject(),
other.getNativeObject()
));
}
/**