1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Merge pull request #111817 from charjr/fix-array-remove-at

Correct Array `remove_at()` class reference
This commit is contained in:
Thaddeus Crews
2025-10-20 18:09:45 -05:00

View File

@@ -684,7 +684,6 @@
Removes the element from the array at the given index ([param position]). If the index is out of bounds, this method fails. If the index is negative, [param position] is considered relative to the end of the array. Removes the element from the array at the given index ([param position]). If the index is out of bounds, this method fails. If the index is negative, [param position] is considered relative to the end of the array.
If you need to return the removed element, use [method pop_at]. To remove an element by value, use [method erase] instead. If you need to return the removed element, use [method pop_at]. To remove an element by value, use [method erase] instead.
[b]Note:[/b] This method shifts every element's index after [param position] back, which may have a noticeable performance cost, especially on larger arrays. [b]Note:[/b] This method shifts every element's index after [param position] back, which may have a noticeable performance cost, especially on larger arrays.
[b]Note:[/b] The [param position] cannot be negative. To remove an element relative to the end of the array, use [code]arr.remove_at(arr.size() - (i + 1))[/code]. To remove the last element from the array, use [code]arr.resize(arr.size() - 1)[/code].
</description> </description>
</method> </method>
<method name="resize"> <method name="resize">