diff options
-rw-r--r-- | core/dictionary.cpp | 7 | ||||
-rw-r--r-- | core/dictionary.h | 3 | ||||
-rw-r--r-- | core/variant_call.cpp | 2 | ||||
-rw-r--r-- | modules/mono/glue/collections_glue.cpp | 4 |
4 files changed, 5 insertions, 11 deletions
diff --git a/core/dictionary.cpp b/core/dictionary.cpp index 42d9eab310..9cc913fa0d 100644 --- a/core/dictionary.cpp +++ b/core/dictionary.cpp @@ -135,12 +135,7 @@ bool Dictionary::has_all(const Array &p_keys) const { return true; } -void Dictionary::erase(const Variant &p_key) { - - _p->variant_map.erase(p_key); -} - -bool Dictionary::erase_checked(const Variant &p_key) { +bool Dictionary::erase(const Variant &p_key) { return _p->variant_map.erase(p_key); } diff --git a/core/dictionary.h b/core/dictionary.h index 00ec67fb99..dbf2233819 100644 --- a/core/dictionary.h +++ b/core/dictionary.h @@ -65,8 +65,7 @@ public: bool has(const Variant &p_key) const; bool has_all(const Array &p_keys) const; - void erase(const Variant &p_key); - bool erase_checked(const Variant &p_key); + bool erase(const Variant &p_key); bool operator==(const Dictionary &p_dictionary) const; diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 20a2929dc0..f5173deabf 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -1649,7 +1649,7 @@ void register_variant_methods() { ADDFUNC0NC(DICTIONARY, NIL, Dictionary, clear, varray()); ADDFUNC1R(DICTIONARY, BOOL, Dictionary, has, NIL, "key", varray()); ADDFUNC1R(DICTIONARY, BOOL, Dictionary, has_all, ARRAY, "keys", varray()); - ADDFUNC1(DICTIONARY, NIL, Dictionary, erase, NIL, "key", varray()); + ADDFUNC1R(DICTIONARY, BOOL, Dictionary, erase, NIL, "key", varray()); ADDFUNC0R(DICTIONARY, INT, Dictionary, hash, varray()); ADDFUNC0R(DICTIONARY, ARRAY, Dictionary, keys, varray()); ADDFUNC0R(DICTIONARY, ARRAY, Dictionary, values, varray()); diff --git a/modules/mono/glue/collections_glue.cpp b/modules/mono/glue/collections_glue.cpp index 0551c1991a..148bb32398 100644 --- a/modules/mono/glue/collections_glue.cpp +++ b/modules/mono/glue/collections_glue.cpp @@ -182,7 +182,7 @@ bool godot_icall_Dictionary_ContainsKey(Dictionary *ptr, MonoObject *key) { } bool godot_icall_Dictionary_RemoveKey(Dictionary *ptr, MonoObject *key) { - return ptr->erase_checked(GDMonoMarshal::mono_object_to_variant(key)); + return ptr->erase(GDMonoMarshal::mono_object_to_variant(key)); } bool godot_icall_Dictionary_Remove(Dictionary *ptr, MonoObject *key, MonoObject *value) { @@ -191,7 +191,7 @@ bool godot_icall_Dictionary_Remove(Dictionary *ptr, MonoObject *key, MonoObject // no dupes Variant *ret = ptr->getptr(varKey); if (ret != NULL && *ret == GDMonoMarshal::mono_object_to_variant(value)) { - ptr->erase_checked(varKey); + ptr->erase(varKey); return true; } |