[jOOQ/jOOQ#14747] Speed up AbstractRow.equals() and hashCode() when comparing with other AbstractRow

This commit is contained in:
Lukas Eder 2023-03-02 16:43:32 +01:00
parent 4838334495
commit ce69995c5f

View File

@ -511,4 +511,23 @@ abstract class AbstractRow<R extends Record> extends AbstractQueryPart implement
// ------------------------------------------------------------------------
// XXX: Object API
// ------------------------------------------------------------------------
@Override
public int hashCode() {
return fields.hashCode();
}
@Override
public boolean equals(Object that) {
if (this == that)
return true;
if (that instanceof AbstractRow<?> r)
return fields.equals(r.fields);
return super.equals(that);
}
}