summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2022-06-18 16:20:55 +0200
committerreduz <reduzio@gmail.com>2022-06-20 12:54:19 +0200
commit141c3755814cea60888c7ee548c7ce709550b784 (patch)
treecc5045d98995b754097d1dde100f0138033fc735 /editor
parent8e3d9a23aa0a724d3dd25fcf0e8085b5a438c233 (diff)
Clean up Hash Functions
Clean up and do fixes to hash functions and newly introduced murmur3 hashes in #61934 * Clean up usage of murmur3 * Fixed usages of binary murmur3 on floats (this is invalid) * Changed DJB2 to use xor (which seems to be better)
Diffstat (limited to 'editor')
-rw-r--r--editor/debugger/debug_adapter/debug_adapter_types.h2
-rw-r--r--editor/debugger/editor_debugger_node.h2
-rw-r--r--editor/plugins/mesh_instance_3d_editor_plugin.cpp4
3 files changed, 4 insertions, 4 deletions
diff --git a/editor/debugger/debug_adapter/debug_adapter_types.h b/editor/debugger/debug_adapter/debug_adapter_types.h
index 4d77b6d51c..fd66905f9b 100644
--- a/editor/debugger/debug_adapter/debug_adapter_types.h
+++ b/editor/debugger/debug_adapter/debug_adapter_types.h
@@ -220,7 +220,7 @@ struct StackFrame {
int column;
static uint32_t hash(const StackFrame &p_frame) {
- return hash_djb2_one_32(p_frame.id);
+ return hash_murmur3_one_32(p_frame.id);
}
bool operator==(const StackFrame &p_other) const {
return id == p_other.id;
diff --git a/editor/debugger/editor_debugger_node.h b/editor/debugger/editor_debugger_node.h
index 8dc53690eb..d50cbec291 100644
--- a/editor/debugger/editor_debugger_node.h
+++ b/editor/debugger/editor_debugger_node.h
@@ -72,7 +72,7 @@ private:
static uint32_t hash(const Breakpoint &p_val) {
uint32_t h = HashMapHasherDefault::hash(p_val.source);
- return hash_djb2_one_32(p_val.line, h);
+ return hash_murmur3_one_32(p_val.line, h);
}
bool operator==(const Breakpoint &p_b) const {
return (line == p_b.line && source == p_b.source);
diff --git a/editor/plugins/mesh_instance_3d_editor_plugin.cpp b/editor/plugins/mesh_instance_3d_editor_plugin.cpp
index d85087b5ea..d1f858315c 100644
--- a/editor/plugins/mesh_instance_3d_editor_plugin.cpp
+++ b/editor/plugins/mesh_instance_3d_editor_plugin.cpp
@@ -350,8 +350,8 @@ struct MeshInstance3DEditorEdgeSort {
Vector2 b;
static uint32_t hash(const MeshInstance3DEditorEdgeSort &p_edge) {
- uint32_t h = hash_djb2_one_32(HashMapHasherDefault::hash(p_edge.a));
- return hash_djb2_one_32(HashMapHasherDefault::hash(p_edge.b), h);
+ uint32_t h = hash_murmur3_one_32(HashMapHasherDefault::hash(p_edge.a));
+ return hash_fmix32(hash_murmur3_one_32(HashMapHasherDefault::hash(p_edge.b), h));
}
bool operator==(const MeshInstance3DEditorEdgeSort &p_b) const {