Skip to content

Commit

Permalink
Hash object values, rather than ordinals
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenewald committed Jul 17, 2023
1 parent adf1eb2 commit 51cc570
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ public Object getFieldObject(int keyOrdinal, int fieldIndex) {
private int hashKeyRecord(HollowObjectTypeReadState typeState, int ordinal) {
int hashCode = 0;
for (int i = 0; i < primaryKey.numFields(); i++) {
int fieldHashCode = HollowReadFieldUtils.fieldHashCode(typeState, ordinal, i);
Object fieldObjectToHash = readValueInState(typeState, ordinal, i);
int fieldHashCode = HollowReadFieldUtils.hashObject(fieldObjectToHash);
hashCode = (hashCode * 31) ^ fieldHashCode;
}
return HashCodes.hashInt(hashCode);
Expand Down

0 comments on commit 51cc570

Please sign in to comment.