Merge pull request #77800 from BWPanda/patch-1

Update Array's `remove_at()` description to cover removing the last element.
This commit is contained in:
Rémi Verschelde 2023-06-20 00:04:24 +02:00
commit 6aa7fd7d8b
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">