You currently use an implementation of GetHashCode() that's invariant under permutation of the fields. This leads to unnecessary hash collisions.
Replace it with an implementation that combines them in an ordered way.
hash = hash0 + hash1 * 31 + hash2 * (31 * 31) + hash3 * (31 * 31 * 31) + ...
Is a common choice.
You currently use an implementation of
GetHashCode()that's invariant under permutation of the fields. This leads to unnecessary hash collisions.Replace it with an implementation that combines them in an ordered way.
hash = hash0 + hash1 * 31 + hash2 * (31 * 31) + hash3 * (31 * 31 * 31) + ...
Is a common choice.