summaryrefslogtreecommitdiffstats
path: root/core/object/class_db.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/object/class_db.cpp')
-rw-r--r--core/object/class_db.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/core/object/class_db.cpp b/core/object/class_db.cpp
index a65411629f..9826d73a9d 100644
--- a/core/object/class_db.cpp
+++ b/core/object/class_db.cpp
@@ -227,16 +227,12 @@ public:
#endif
bool ClassDB::_is_parent_class(const StringName &p_class, const StringName &p_inherits) {
- if (!classes.has(p_class)) {
- return false;
- }
-
- StringName inherits = p_class;
- while (inherits.operator String().length()) {
- if (inherits == p_inherits) {
+ ClassInfo *c = classes.getptr(p_class);
+ while (c) {
+ if (c->name == p_inherits) {
return true;
}
- inherits = _get_parent_class(inherits);
+ c = c->inherits_ptr;
}
return false;
@@ -2310,4 +2306,11 @@ void ClassDB::cleanup() {
native_structs.clear();
}
+// Array to use in optional parameters on methods and the DEFVAL_ARRAY macro.
+Array ClassDB::default_array_arg = Array::create_read_only();
+
+bool ClassDB::is_default_array_arg(const Array &p_array) {
+ return p_array.is_same_instance(default_array_arg);
+}
+
//