diff options
author | kobewi <kobewi4e@gmail.com> | 2023-09-04 17:01:33 +0200 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2024-05-11 18:53:08 +0200 |
commit | a262d2d8811a43c906a4cac55b7126ebec7699be (patch) | |
tree | 0507fff0aed8778e71a2afc0a2d4ac15184e7803 /core/variant | |
parent | 916ea002c15e82879f3eada7c635daaecccc9e35 (diff) | |
download | redot-engine-a262d2d8811a43c906a4cac55b7126ebec7699be.tar.gz |
Add shorthand for using singleton string names
Diffstat (limited to 'core/variant')
-rw-r--r-- | core/variant/variant.cpp | 2 | ||||
-rw-r--r-- | core/variant/variant_setget.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/core/variant/variant.cpp b/core/variant/variant.cpp index 3a499a2bcd..8be00b1358 100644 --- a/core/variant/variant.cpp +++ b/core/variant/variant.cpp @@ -2121,7 +2121,7 @@ Variant::operator ::RID() const { } #endif Callable::CallError ce; - Variant ret = _get_obj().obj->callp(CoreStringNames::get_singleton()->get_rid, nullptr, 0, ce); + Variant ret = _get_obj().obj->callp(CoreStringName(get_rid), nullptr, 0, ce); if (ce.error == Callable::CallError::CALL_OK && ret.get_type() == Variant::RID) { return ret; } diff --git a/core/variant/variant_setget.cpp b/core/variant/variant_setget.cpp index 96c52260d9..48176163a1 100644 --- a/core/variant/variant_setget.cpp +++ b/core/variant/variant_setget.cpp @@ -1384,7 +1384,7 @@ bool Variant::iter_init(Variant &r_iter, bool &valid) const { ref.push_back(r_iter); Variant vref = ref; const Variant *refp[] = { &vref }; - Variant ret = _get_obj().obj->callp(CoreStringNames::get_singleton()->_iter_init, refp, 1, ce); + Variant ret = _get_obj().obj->callp(CoreStringName(_iter_init), refp, 1, ce); if (ref.size() != 1 || ce.error != Callable::CallError::CALL_OK) { valid = false; @@ -1619,7 +1619,7 @@ bool Variant::iter_next(Variant &r_iter, bool &valid) const { ref.push_back(r_iter); Variant vref = ref; const Variant *refp[] = { &vref }; - Variant ret = _get_obj().obj->callp(CoreStringNames::get_singleton()->_iter_next, refp, 1, ce); + Variant ret = _get_obj().obj->callp(CoreStringName(_iter_next), refp, 1, ce); if (ref.size() != 1 || ce.error != Callable::CallError::CALL_OK) { valid = false; @@ -1811,7 +1811,7 @@ Variant Variant::iter_get(const Variant &r_iter, bool &r_valid) const { Callable::CallError ce; ce.error = Callable::CallError::CALL_OK; const Variant *refp[] = { &r_iter }; - Variant ret = _get_obj().obj->callp(CoreStringNames::get_singleton()->_iter_get, refp, 1, ce); + Variant ret = _get_obj().obj->callp(CoreStringName(_iter_get), refp, 1, ce); if (ce.error != Callable::CallError::CALL_OK) { r_valid = false; |