Refactor some object type checking code with cast_to
Less stringly typed logic, and less String allocations and comparisons.
This commit is contained in:
parent
0154ce2c8d
commit
317cd0b19a
29 changed files with 140 additions and 171 deletions
|
|
@ -93,7 +93,7 @@ Variant PluginScript::_new(const Variant **p_args, int p_argcount, Callable::Cal
|
|||
REF ref;
|
||||
Object *owner = nullptr;
|
||||
|
||||
if (get_instance_base_type() == "") {
|
||||
if (get_instance_base_type() == StringName()) {
|
||||
owner = memnew(RefCounted);
|
||||
} else {
|
||||
owner = ClassDB::instantiate(get_instance_base_type());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue