summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Reference.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2012-08-10 19:05:05 +0200
committerJose <jose@zeroc.com>2012-08-10 19:05:05 +0200
commitdac1de9cee466c49bb66d1fa3ff3e7f8ce74b41d (patch)
treee21599db79868ffc65be32b4dda2056af9e18b0b /cpp/src/Ice/Reference.cpp
parentRemove some more VC6 compiler fixes (diff)
downloadice-dac1de9cee466c49bb66d1fa3ff3e7f8ce74b41d.tar.bz2
ice-dac1de9cee466c49bb66d1fa3ff3e7f8ce74b41d.tar.xz
ice-dac1de9cee466c49bb66d1fa3ff3e7f8ce74b41d.zip
ICE-4702 - Poor hash algorithm
Diffstat (limited to 'cpp/src/Ice/Reference.cpp')
-rw-r--r--cpp/src/Ice/Reference.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp
index 3ec8385c214..0b8a6eaff7b 100644
--- a/cpp/src/Ice/Reference.cpp
+++ b/cpp/src/Ice/Reference.cpp
@@ -483,12 +483,20 @@ IceInternal::Reference::Reference(const Reference& r) :
int
IceInternal::Reference::hashInit() const
{
- Int h = static_cast<Int>(_mode);
+ Int h = 5381;
+ hashAdd(h, static_cast<Int>(_mode));
+ hashAdd(h, _secure);
hashAdd(h, _identity.name);
hashAdd(h, _identity.category);
hashAdd(h, _context->getValue());
hashAdd(h, _facet);
- hashAdd(h, _secure);
+ hashAdd(h, _overrideCompress);
+ if(_overrideCompress)
+ {
+ hashAdd(h, _compress);
+ }
+ hashAdd(h, _encoding.major);
+ hashAdd(h, _encoding.minor);
return h;
}