diff options
author | Bernard Normier <bernard@zeroc.com> | 2017-01-16 18:34:15 -0500 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2017-01-17 10:06:01 -0500 |
commit | 2df92e167a62ae67401225086e165f82293446e9 (patch) | |
tree | 4513f77a96095cd42eb882f571b49b2a128576e7 /cpp/src/slice2objc | |
parent | Revert "Fixed hash algo for Long and Double" (diff) | |
download | ice-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.cpp | 7 |
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: |