summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorIgnacio Etcheverry <neikeq@users.noreply.github.com>2018-07-23 23:59:04 +0200
committerGitHub <noreply@github.com>2018-07-23 23:59:04 +0200
commit779c9d638e7046f285b301aa79f7cf50aa4c2f1c (patch)
tree9a1f806ac10da3b1d125a68739ab9f66fad81789 /core
parentb66580927e8d4d0fb568d66d2193c1f2a6772c88 (diff)
parentee3c476c9a8a3be949252468570e75f35fea2697 (diff)
Merge pull request #15880 from neikeq/better-collections
Mono: Add Dictionary and Array classes
Diffstat (limited to 'core')
-rw-r--r--core/dictionary.cpp5
-rw-r--r--core/dictionary.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/core/dictionary.cpp b/core/dictionary.cpp
index d68411a572..42d9eab310 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 84a5cafe1d..00ec67fb99 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;