diff options
author | Ninni Pipping <over999ships@gmail.com> | 2023-03-08 12:52:50 +0100 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-03-27 17:18:16 +0200 |
commit | 4da5fc9203e7308a64c91bfa8cfb8a4592010e2f (patch) | |
tree | cb270aeac919822bf4e28b46f3b49bab723f9e14 | |
parent | 636d7905b061311eaaeec61f88cdc1a627013f54 (diff) |
Fix Variant hashing for floats
Incorrectly hashed floats as single precision
(cherry picked from commit e6a9e0cdec2c309f9201d0ab475616c51010b531)
-rw-r--r-- | core/variant/variant.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/variant/variant.cpp b/core/variant/variant.cpp index 2da9559873..fa3bb78913 100644 --- a/core/variant/variant.cpp +++ b/core/variant/variant.cpp @@ -2941,7 +2941,7 @@ uint32_t Variant::recursive_hash(int recursion_count) const { return hash_one_uint64((uint64_t)_data._int); } break; case FLOAT: { - return hash_murmur3_one_float(_data._float); + return hash_murmur3_one_double(_data._float); } break; case STRING: { return reinterpret_cast<const String *>(_data._mem)->hash(); @@ -3158,7 +3158,7 @@ uint32_t Variant::recursive_hash(int recursion_count) const { } return hash_fmix32(h); } else { - return hash_murmur3_one_float(0.0); + return hash_murmur3_one_double(0.0); } } break; |