summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-06-20 00:04:24 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-06-20 00:04:24 +0200
commit6aa7fd7d8bb196948a433f2fec18b76125f787fb (patch)
treeb59e7b4b385e5aa57b20d9932c972723b66a9c5c
parent75ef6e486c7f0e1e50463c54b65f454810608a21 (diff)
parentbdffb74f06952e94ac5a722fd308d8139344fb2b (diff)
downloadredot-engine-6aa7fd7d8bb196948a433f2fec18b76125f787fb.tar.gz
Merge pull request #77800 from BWPanda/patch-1
Update Array's `remove_at()` description to cover removing the last element.
-rw-r--r--doc/classes/Array.xml1
1 files changed, 1 insertions, 0 deletions
diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml
index cdfc04c62f..bed9768603 100644
--- a/doc/classes/Array.xml
+++ b/doc/classes/Array.xml
@@ -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">