summaryrefslogtreecommitdiff
path: root/cpp/src/slice2objc
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2017-01-16 18:34:15 -0500
committerBernard Normier <bernard@zeroc.com>2017-01-17 10:06:01 -0500
commit2df92e167a62ae67401225086e165f82293446e9 (patch)
tree4513f77a96095cd42eb882f571b49b2a128576e7 /cpp/src/slice2objc
parentRevert "Fixed hash algo for Long and Double" (diff)
downloadice-2df92e167a62ae67401225086e165f82293446e9.tar.bz2
ice-2df92e167a62ae67401225086e165f82293446e9.tar.xz
ice-2df92e167a62ae67401225086e165f82293446e9.zip
Fixed hash algo for Long and Double
Diffstat (limited to 'cpp/src/slice2objc')
-rw-r--r--cpp/src/slice2objc/Gen.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/cpp/src/slice2objc/Gen.cpp b/cpp/src/slice2objc/Gen.cpp
index d3316087916..718204ecab6 100644
--- a/cpp/src/slice2objc/Gen.cpp
+++ b/cpp/src/slice2objc/Gen.cpp
@@ -2035,7 +2035,7 @@ Slice::Gen::TypesVisitor::writeMemberHashCode(const DataMemberList& dataMembers,
{
case Builtin::KindLong:
{
- _M << nl << "h_ = ((h_ << 5) + h_) ^ (uint)(" << name << " ^ (" << name << " >> 32));";
+ _M << nl << "h_ = ((h_ << 5) + h_) ^ [@(" << name << ") hash];";
break;
}
case Builtin::KindFloat:
@@ -2045,10 +2045,7 @@ Slice::Gen::TypesVisitor::writeMemberHashCode(const DataMemberList& dataMembers,
}
case Builtin::KindDouble:
{
- _M << sb;
- _M << nl << "unsigned long long bits_ = (unsigned long long)" << name << ";";
- _M << nl << "h_ = ((h_ << 5) + h_) ^ (uint)(bits_ ^ (bits_ >> 32));";
- _M << eb;
+ _M << nl << "h_ = ((h_ << 5) + h_) ^ [@(" << name << ") hash];";
break;
}
default: