Improve SctpMessage.hashCode method
Motivation: Not all fields of SctpMessage which used to check message equality are used to generate hashcode. Modifications: Use value of 'unordered' field in hashCode method. Result: Better hash function of SctpMessage.
This commit is contained in:
parent
a157528ec2
commit
4eaa59d516
@ -142,6 +142,8 @@ public final class SctpMessage extends DefaultByteBufHolder {
|
|||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int result = streamIdentifier;
|
int result = streamIdentifier;
|
||||||
result = 31 * result + protocolIdentifier;
|
result = 31 * result + protocolIdentifier;
|
||||||
|
// values 1231 and 1237 are referenced in the javadocs of Boolean#hashCode()
|
||||||
|
result = 31 * result + (unordered ? 1231 : 1237);
|
||||||
result = 31 * result + content().hashCode();
|
result = 31 * result + content().hashCode();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user