diff options
author | Jose <jose@zeroc.com> | 2012-08-10 19:05:05 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2012-08-10 19:05:05 +0200 |
commit | dac1de9cee466c49bb66d1fa3ff3e7f8ce74b41d (patch) | |
tree | e21599db79868ffc65be32b4dda2056af9e18b0b /java/src/IceInternal/OpaqueEndpointI.java | |
parent | Remove some more VC6 compiler fixes (diff) | |
download | ice-dac1de9cee466c49bb66d1fa3ff3e7f8ce74b41d.tar.bz2 ice-dac1de9cee466c49bb66d1fa3ff3e7f8ce74b41d.tar.xz ice-dac1de9cee466c49bb66d1fa3ff3e7f8ce74b41d.zip |
ICE-4702 - Poor hash algorithm
Diffstat (limited to 'java/src/IceInternal/OpaqueEndpointI.java')
-rw-r--r-- | java/src/IceInternal/OpaqueEndpointI.java | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/java/src/IceInternal/OpaqueEndpointI.java b/java/src/IceInternal/OpaqueEndpointI.java index 3982b095415..f40763a418a 100644 --- a/java/src/IceInternal/OpaqueEndpointI.java +++ b/java/src/IceInternal/OpaqueEndpointI.java @@ -433,13 +433,11 @@ final class OpaqueEndpointI extends EndpointI private void calcHashValue() { - _hashCode = _type; - _hashCode = 5 * _hashCode + _rawEncoding.major; - _hashCode = 5 * _hashCode + _rawEncoding.minor; - for(int i = 0; i < _rawBytes.length; i++) - { - _hashCode = 5 * _hashCode + _rawBytes[i]; - } + int h = 5381; + h = IceInternal.HashUtil.hashAdd(h, _type); + h = IceInternal.HashUtil.hashAdd(h, _rawEncoding); + h = IceInternal.HashUtil.hashAdd(h, _rawBytes); + _hashCode = h; } private short _type; |