diff options
Diffstat (limited to 'java/src/IceInternal/TcpEndpointI.java')
-rw-r--r-- | java/src/IceInternal/TcpEndpointI.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/java/src/IceInternal/TcpEndpointI.java b/java/src/IceInternal/TcpEndpointI.java index 0d2ab229193..18426c4494d 100644 --- a/java/src/IceInternal/TcpEndpointI.java +++ b/java/src/IceInternal/TcpEndpointI.java @@ -556,13 +556,16 @@ final class TcpEndpointI extends EndpointI private void calcHashValue() { - _hashCode = _host.hashCode(); - _hashCode = 5 * _hashCode + _port; - _hashCode = 5 * _hashCode + _timeout; - _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.TCPEndpointType.value); + h = IceInternal.HashUtil.hashAdd(h, _host); + h = IceInternal.HashUtil.hashAdd(h, _port); + h = IceInternal.HashUtil.hashAdd(h, _timeout); + 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; |