Typed array equality operator logic updated

• Instead of calling to `_ref`, the same effect is achieved by calling to the base class assignment operator
• No longer need to be expose `_ref`; set back to private & remove reference from gdextension_interface
This commit is contained in:
Thaddeus Crews
2023-09-28 12:47:39 -05:00
parent 209a446e36
commit 5b935881fc
4 changed files with 11 additions and 7 deletions

View File

@ -1277,11 +1277,13 @@ static GDExtensionVariantPtr gdextension_array_operator_index_const(GDExtensionC
return (GDExtensionVariantPtr)&self->operator[](p_index);
}
#ifndef DISABLE_DEPRECATED
void gdextension_array_ref(GDExtensionTypePtr p_self, GDExtensionConstTypePtr p_from) {
Array *self = (Array *)p_self;
const Array *from = (const Array *)p_from;
self->_ref(*from);
self->Array::operator=(*from);
}
#endif // DISABLE_DEPRECATED
void gdextension_array_set_typed(GDExtensionTypePtr p_self, GDExtensionVariantType p_type, GDExtensionConstStringNamePtr p_class_name, GDExtensionConstVariantPtr p_script) {
Array *self = reinterpret_cast<Array *>(p_self);
@ -1798,7 +1800,9 @@ void gdextension_setup_interface() {
REGISTER_INTERFACE_FUNC(packed_vector4_array_operator_index_const);
REGISTER_INTERFACE_FUNC(array_operator_index);
REGISTER_INTERFACE_FUNC(array_operator_index_const);
#ifndef DISABLE_DEPRECATED
REGISTER_INTERFACE_FUNC(array_ref);
#endif // DISABLE_DEPRECATED
REGISTER_INTERFACE_FUNC(array_set_typed);
REGISTER_INTERFACE_FUNC(dictionary_operator_index);
REGISTER_INTERFACE_FUNC(dictionary_operator_index_const);