Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,36 @@ long longHashCode() {
hashUpdated = true;
return hashCode;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof IntSet that)) {
return false;
}
if (size() != that.size()) {
return false;
}
if (longHashCode() != that.longHashCode()) {
return false;
}
if (that instanceof FrozenIntSet frozen) {
int[] vals = frozen.values;
for (int val : vals) {
if (!inner.containsKey(val)) {
return false;
}
}
return true;
}
if (that instanceof StateSet otherStateSet) {
for (IntCursor key : otherStateSet.inner.keys()) {
if (!inner.containsKey(key.value)) {
return false;
}
}
return true;
}
return Arrays.equals(getArray(), 0, size(), that.getArray(), 0, that.size());
}
}
Loading