summaryrefslogtreecommitdiff
path: root/modules/gdnative/pluginscript/pluginscript_script.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-02-06 14:12:19 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-02-08 10:08:34 +0100
commit317cd0b19a284f9a7296fcb4e06d9b2362da8c85 (patch)
treebdc9052230c16a9c6dcab330e84f51c8b62658e7 /modules/gdnative/pluginscript/pluginscript_script.cpp
parent0154ce2c8d66528d617e10b139640fd4c4405c6b (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.cpp2
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());