From 7e3dcf3ac095bdcb96dc0d0e7f7f4bc9da00c2e4 Mon Sep 17 00:00:00 2001 From: John Date: Sun, 19 Oct 2025 11:54:58 +0100 Subject: [PATCH] Correct Array `remove_at` class reference `remove_at` can take negative positions as relative to the end of the array. The note is no longer needed and contradictory to the first paragraph. --- doc/classes/Array.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index caaf82fc334..66c2b667752 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -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. 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] 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].