diff options
Diffstat (limited to 'java/src/IceInternal/UdpEndpointI.java')
-rw-r--r-- | java/src/IceInternal/UdpEndpointI.java | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/java/src/IceInternal/UdpEndpointI.java b/java/src/IceInternal/UdpEndpointI.java index d3a8c23f27f..8e78a33079c 100644 --- a/java/src/IceInternal/UdpEndpointI.java +++ b/java/src/IceInternal/UdpEndpointI.java @@ -583,15 +583,18 @@ final class UdpEndpointI extends EndpointI private void calcHashValue() { - _hashCode = _host.hashCode(); - _hashCode = 5 * _hashCode + _port; - _hashCode = 5 * _hashCode + _mcastInterface.hashCode(); - _hashCode = 5 * _hashCode + _mcastTtl; - _hashCode = 5 * _hashCode + (_connect ? 1 : 0); - _hashCode = 5 * _hashCode + _protocol.hashCode(); - _hashCode = 5 * _hashCode + _encoding.hashCode(); - _hashCode = 5 * _hashCode + _connectionId.hashCode(); - _hashCode = 5 * _hashCode + (_compress ? 1 : 0); + int h = 5381; + h = IceInternal.HashUtil.hashAdd(h, Ice.UDPEndpointType.value); + h = IceInternal.HashUtil.hashAdd(h, _host); + h = IceInternal.HashUtil.hashAdd(h, _port); + h = IceInternal.HashUtil.hashAdd(h, _mcastInterface); + h = IceInternal.HashUtil.hashAdd(h, _mcastTtl); + h = IceInternal.HashUtil.hashAdd(h, _connect); + h = IceInternal.HashUtil.hashAdd(h, _protocol); + h = IceInternal.HashUtil.hashAdd(h, _encoding); + h = IceInternal.HashUtil.hashAdd(h, _connectionId); + h = IceInternal.HashUtil.hashAdd(h, _compress); + _hashCode = h; } private Instance _instance; |