diff options
| author | Karroffel | 2017-05-23 22:55:51 +0200 |
|---|---|---|
| committer | Karroffel | 2017-05-23 22:57:02 +0200 |
| commit | f23b56e3ecc5de8fc823dfa1c63f71d51ea12993 (patch) | |
| tree | 116e4e886547b4503f28740cf98d5c674b5840da /modules/gdnative/godot/godot_array.cpp | |
| parent | f4f7d6d58d9d4b5dc6920d71247895925ea247ab (diff) | |
| download | godot-f23b56e3ecc5de8fc823dfa1c63f71d51ea12993.tar.gz godot-f23b56e3ecc5de8fc823dfa1c63f71d51ea12993.tar.zst godot-f23b56e3ecc5de8fc823dfa1c63f71d51ea12993.zip | |
Diffstat (limited to 'modules/gdnative/godot/godot_array.cpp')
| -rw-r--r-- | modules/gdnative/godot/godot_array.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/modules/gdnative/godot/godot_array.cpp b/modules/gdnative/godot/godot_array.cpp index 65353c5b0..bf2ef3597 100644 --- a/modules/gdnative/godot/godot_array.cpp +++ b/modules/gdnative/godot/godot_array.cpp @@ -139,13 +139,9 @@ void GDAPI godot_array_set(godot_array *p_arr, const godot_int p_idx, const godo a->operator[](p_idx) = *val; } -godot_variant GDAPI godot_array_get(const godot_array *p_arr, const godot_int p_idx) { - godot_variant raw_dest; - Variant *dest = (Variant *)&raw_dest; - memnew_placement(dest, Variant); - const Array *a = (const Array *)p_arr; - *dest = a->operator[](p_idx); - return raw_dest; +godot_variant GDAPI *godot_array_get(const godot_array *p_arr, const godot_int p_idx) { + Array *a = (Array *)p_arr; + return (godot_variant *)&a->operator[](p_idx); } void GDAPI godot_array_append(godot_array *p_arr, const godot_variant *p_value) { |
