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.
This commit is contained in:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user