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
c864c4135c
commit
6282ae4f4c
@ -146,6 +146,8 @@ public final class SctpMessage extends DefaultByteBufHolder {
|
||||
public int hashCode() {
|
||||
int result = streamIdentifier;
|
||||
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();
|
||||
return result;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user