Update Array's remove_at() description to cover removing the last element

This commit is contained in:
Peter Anderson 2023-06-03 11:46:45 +00:00 committed by Rémi Verschelde
parent 764193629f
commit bdffb74f06
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -536,6 +536,7 @@
Removes an element from the array by index. If the index does not exist in the array, nothing happens. To remove an element by searching for its value, use [method erase] instead.
[b]Note:[/b] This method acts in-place and doesn't return a value.
[b]Note:[/b] On large arrays, this method will be slower if the removed element is close to the beginning of the array (index 0). This is because all elements placed after the removed element have to be reindexed.
[b]Note:[/b] [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 without returning the value, use [code]arr.resize(arr.size() - 1)[/code].
</description>
</method>
<method name="resize">