summaryrefslogtreecommitdiff
path: root/core/object
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2020-12-28 13:23:25 +0100
committerGitHub <noreply@github.com>2020-12-28 13:23:25 +0100
commitbe509bf5e4d00b33f2867e6d06a23285b2a8fd29 (patch)
tree975e0a7384bc6fc7cf5b73b9ddc1e8eef13579d8 /core/object
parent886571e0fc54914f161ab3f1ccf9bfe40411bc20 (diff)
parent5b937d493f0046543a77a0be7920ad39f1e5fc3c (diff)
Merge pull request #44401 from madmiraal/rename-empty-is_empty
Rename empty() to is_empty()
Diffstat (limited to 'core/object')
-rw-r--r--core/object/class_db.cpp2
-rw-r--r--core/object/object.cpp12
-rw-r--r--core/object/script_language.cpp2
3 files changed, 8 insertions, 8 deletions
diff --git a/core/object/class_db.cpp b/core/object/class_db.cpp
index f5171f60ec..6cdaacf164 100644
--- a/core/object/class_db.cpp
+++ b/core/object/class_db.cpp
@@ -377,7 +377,7 @@ uint64_t ClassDB::get_api_hash(APIType p_api) {
while ((k = t->method_map.next(k))) {
String name = k->operator String();
- ERR_CONTINUE(name.empty());
+ ERR_CONTINUE(name.is_empty());
if (name[0] == '_') {
continue; // Ignore non-virtual methods that start with an underscore
diff --git a/core/object/object.cpp b/core/object/object.cpp
index 681e1188ff..a53925f990 100644
--- a/core/object/object.cpp
+++ b/core/object/object.cpp
@@ -506,7 +506,7 @@ Variant Object::get(const StringName &p_name, bool *r_valid) const {
}
void Object::set_indexed(const Vector<StringName> &p_names, const Variant &p_value, bool *r_valid) {
- if (p_names.empty()) {
+ if (p_names.is_empty()) {
if (r_valid) {
*r_valid = false;
}
@@ -561,11 +561,11 @@ void Object::set_indexed(const Vector<StringName> &p_names, const Variant &p_val
set(p_names[0], value_stack.back()->get(), r_valid);
value_stack.pop_back();
- ERR_FAIL_COND(!value_stack.empty());
+ ERR_FAIL_COND(!value_stack.is_empty());
}
Variant Object::get_indexed(const Vector<StringName> &p_names, bool *r_valid) const {
- if (p_names.empty()) {
+ if (p_names.is_empty()) {
if (r_valid) {
*r_valid = false;
}
@@ -599,7 +599,7 @@ void Object::get_property_list(List<PropertyInfo> *p_list, bool p_reversed) cons
if (!is_class("Script")) { // can still be set, but this is for userfriendlyness
p_list->push_back(PropertyInfo(Variant::OBJECT, "script", PROPERTY_HINT_RESOURCE_TYPE, "Script", PROPERTY_USAGE_DEFAULT));
}
- if (!metadata.empty()) {
+ if (!metadata.is_empty()) {
p_list->push_back(PropertyInfo(Variant::DICTIONARY, "__meta__", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL));
}
if (script_instance && !p_reversed) {
@@ -1089,7 +1089,7 @@ Error Object::emit_signal(const StringName &p_name, const Variant **p_args, int
}
}
- while (!disconnect_data.empty()) {
+ while (!disconnect_data.is_empty()) {
const _ObjectSignalDisconnectData &dd = disconnect_data.front()->get();
_disconnect(dd.signal, dd.callable);
@@ -1373,7 +1373,7 @@ void Object::_disconnect(const StringName &p_signal, const Callable &p_callable,
target_object->connections.erase(slot->cE);
s->slot_map.erase(*p_callable.get_base_comparator());
- if (s->slot_map.empty() && ClassDB::has_signal(get_class_name(), p_signal)) {
+ if (s->slot_map.is_empty() && ClassDB::has_signal(get_class_name(), p_signal)) {
//not user signal, delete
signal_map.erase(p_signal);
}
diff --git a/core/object/script_language.cpp b/core/object/script_language.cpp
index 17ac75e19f..f9cc517448 100644
--- a/core/object/script_language.cpp
+++ b/core/object/script_language.cpp
@@ -275,7 +275,7 @@ void ScriptServer::save_global_classes() {
gcarr.push_back(d);
}
- if (gcarr.empty()) {
+ if (gcarr.is_empty()) {
if (ProjectSettings::get_singleton()->has_setting("_global_script_classes")) {
ProjectSettings::get_singleton()->clear("_global_script_classes");
}