浏览代码

Merge pull request #74600 from AThousandShips/hash_float_fix

Fix Variant hashing for floats
Rémi Verschelde 2 年之前
父节点
当前提交
8defa73dc2
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      core/variant/variant.cpp

+ 2 - 2
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);
 			return hash_one_uint64((uint64_t)_data._int);
 		} break;
 		} break;
 		case FLOAT: {
 		case FLOAT: {
-			return hash_murmur3_one_float(_data._float);
+			return hash_murmur3_one_double(_data._float);
 		} break;
 		} break;
 		case STRING: {
 		case STRING: {
 			return reinterpret_cast<const String *>(_data._mem)->hash();
 			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);
 				return hash_fmix32(h);
 			} else {
 			} else {
-				return hash_murmur3_one_float(0.0);
+				return hash_murmur3_one_double(0.0);
 			}
 			}
 
 
 		} break;
 		} break;