diff --git a/core/dictionary.cpp b/core/dictionary.cpp index d68411a5728..42d9eab3106 100644 --- a/core/dictionary.cpp +++ b/core/dictionary.cpp @@ -140,6 +140,11 @@ void Dictionary::erase(const Variant &p_key) { _p->variant_map.erase(p_key); } +bool Dictionary::erase_checked(const Variant &p_key) { + + return _p->variant_map.erase(p_key); +} + bool Dictionary::operator==(const Dictionary &p_dictionary) const { return _p == p_dictionary._p; diff --git a/core/dictionary.h b/core/dictionary.h index 84a5cafe1d1..00ec67fb992 100644 --- a/core/dictionary.h +++ b/core/dictionary.h @@ -66,6 +66,7 @@ public: bool has_all(const Array &p_keys) const; void erase(const Variant &p_key); + bool erase_checked(const Variant &p_key); bool operator==(const Dictionary &p_dictionary) const;