C#: Mostly fix hash of ManagedCallable

The hash can still change when reloading assemblies but in all other
cases the result should be correct.
This commit is contained in:
RedworkDE
2023-05-18 13:44:36 +02:00
parent da21cb7042
commit 1cfc382fe8
5 changed files with 24 additions and 4 deletions

View File

@@ -43,10 +43,10 @@ bool ManagedCallable::compare_equal(const CallableCustom *p_a, const CallableCus
const ManagedCallable *a = static_cast<const ManagedCallable *>(p_a);
const ManagedCallable *b = static_cast<const ManagedCallable *>(p_b);
if (a->delegate_handle.value == b->delegate_handle.value) {
return true;
}
if (!a->delegate_handle.value || !b->delegate_handle.value) {
if (!a->delegate_handle.value && !b->delegate_handle.value) {
return true;
}
return false;
}
@@ -63,7 +63,7 @@ bool ManagedCallable::compare_less(const CallableCustom *p_a, const CallableCust
}
uint32_t ManagedCallable::hash() const {
return hash_murmur3_one_64((uint64_t)delegate_handle.value);
return GDMonoCache::managed_callbacks.DelegateUtils_DelegateHash(delegate_handle);
}
String ManagedCallable::get_as_text() const {