diff options
| author | RedworkDE <10944644+RedworkDE@users.noreply.github.com> | 2023-05-18 13:44:36 +0200 |
|---|---|---|
| committer | RedworkDE <10944644+RedworkDE@users.noreply.github.com> | 2023-05-18 13:44:36 +0200 |
| commit | 1cfc382fe89ba9df3d9edc2de07fbc28e594193a (patch) | |
| tree | f7064c6577cc74302006c554c8fee7c2fbc38390 /modules/mono/managed_callable.cpp | |
| parent | da21cb7042b09de24964b9bd5a1a8e1d93ab4b8b (diff) | |
| download | redot-engine-1cfc382fe89ba9df3d9edc2de07fbc28e594193a.tar.gz | |
C#: Mostly fix hash of ManagedCallable
The hash can still change when reloading assemblies but in all other
cases the result should be correct.
Diffstat (limited to 'modules/mono/managed_callable.cpp')
| -rw-r--r-- | modules/mono/managed_callable.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/mono/managed_callable.cpp b/modules/mono/managed_callable.cpp index 3e4eb5a966..faf3ae7b04 100644 --- a/modules/mono/managed_callable.cpp +++ b/modules/mono/managed_callable.cpp @@ -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 { |
