From f84e2db35e2f6eceb4f8c3a1e8e9de7adf6f4c30 Mon Sep 17 00:00:00 2001 From: Ryan Roden-Corrent Date: Tue, 5 Apr 2022 07:07:56 -0400 Subject: [PATCH] Clarify Array.erase for nonexistant element. The docs specify that Array.remove does nothing if the index does not exist. Array.erase does not have a similar phrase, so it's unclear if erase will print an error, or silently do nothing. --- doc/classes/Array.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index 68cb6152096..b5196a19d75 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -194,7 +194,7 @@ - Removes the first occurrence of a value from the array. To remove an element by index, use [method remove_at] instead. + Removes the first occurrence of a value from the array. If the value does not exist in the array, nothing happens. To remove an element by index, use [method remove_at] 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.