summaryrefslogtreecommitdiffstats
path: root/core/dictionary.cpp
diff options
context:
space:
mode:
authorIgnacio Etcheverry <ignalfonsore@gmail.com>2018-07-18 23:07:31 +0200
committerIgnacio Etcheverry <ignalfonsore@gmail.com>2018-07-18 23:07:31 +0200
commit2f69e36cef8acca00ec5445f4aa8ec538bb38e3e (patch)
tree41636816175e80d46692b75fdc85d60ea2655e53 /core/dictionary.cpp
parenta731bd58643da57f3c3846102c9173651ef7478b (diff)
downloadredot-engine-2f69e36cef8acca00ec5445f4aa8ec538bb38e3e.tar.gz
Add Dictionary::erase_checked(key) method
Same as erase, but it returns a boolean value indicating whether the pair was erased or not. This method should be removed during the next compatibility breakage, and 'Dictionary::erase(key)' should be changed to return a boolean.
Diffstat (limited to 'core/dictionary.cpp')
-rw-r--r--core/dictionary.cpp5
1 files changed, 5 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;