diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-02-06 14:12:19 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-02-08 10:08:34 +0100 |
commit | 317cd0b19a284f9a7296fcb4e06d9b2362da8c85 (patch) | |
tree | bdc9052230c16a9c6dcab330e84f51c8b62658e7 /modules/gdnative/pluginscript/pluginscript_script.cpp | |
parent | 0154ce2c8d66528d617e10b139640fd4c4405c6b (diff) |
Refactor some object type checking code with `cast_to`
Less stringly typed logic, and less String allocations and comparisons.
Diffstat (limited to 'modules/gdnative/pluginscript/pluginscript_script.cpp')
-rw-r--r-- | modules/gdnative/pluginscript/pluginscript_script.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gdnative/pluginscript/pluginscript_script.cpp b/modules/gdnative/pluginscript/pluginscript_script.cpp index 71ab8ef0a2..ec3c9eb4ff 100644 --- a/modules/gdnative/pluginscript/pluginscript_script.cpp +++ b/modules/gdnative/pluginscript/pluginscript_script.cpp @@ -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()); |