mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 23:31:53 -05:00
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)
This commit is contained in:
@@ -91,7 +91,7 @@ GDScriptLambdaCallable::GDScriptLambdaCallable(Ref<GDScript> p_script, GDScriptF
|
||||
function = p_function;
|
||||
captures = p_captures;
|
||||
|
||||
h = (uint32_t)hash_djb2_one_64((uint64_t)this);
|
||||
h = (uint32_t)hash_murmur3_one_64((uint64_t)this);
|
||||
}
|
||||
|
||||
bool GDScriptLambdaSelfCallable::compare_equal(const CallableCustom *p_a, const CallableCustom *p_b) {
|
||||
@@ -161,7 +161,7 @@ GDScriptLambdaSelfCallable::GDScriptLambdaSelfCallable(Ref<RefCounted> p_self, G
|
||||
function = p_function;
|
||||
captures = p_captures;
|
||||
|
||||
h = (uint32_t)hash_djb2_one_64((uint64_t)this);
|
||||
h = (uint32_t)hash_murmur3_one_64((uint64_t)this);
|
||||
}
|
||||
|
||||
GDScriptLambdaSelfCallable::GDScriptLambdaSelfCallable(Object *p_self, GDScriptFunction *p_function, const Vector<Variant> &p_captures) {
|
||||
@@ -169,5 +169,5 @@ GDScriptLambdaSelfCallable::GDScriptLambdaSelfCallable(Object *p_self, GDScriptF
|
||||
function = p_function;
|
||||
captures = p_captures;
|
||||
|
||||
h = (uint32_t)hash_djb2_one_64((uint64_t)this);
|
||||
h = (uint32_t)hash_murmur3_one_64((uint64_t)this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user