From 457ccb21b6ef90349dc388dd21a3595deaeacfaf Mon Sep 17 00:00:00 2001 From: kobewi Date: Thu, 3 Jun 2021 17:41:02 +0200 Subject: [PATCH] Improve sort_custom() description (cherry picked from commit 48f0368ddc19c16387f190ef8339de69b70d11ae) --- doc/classes/Array.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index 7449cf504d..29b5690153 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -397,6 +397,7 @@ Sorts the array using a custom method. The arguments are an object that holds the method and the name of such method. The custom method receives two arguments (a pair of elements from the array) and must return either [code]true[/code] or [code]false[/code]. + For two elements [code]a[/code] and [code]b[/code], if the given method returns [code]true[/code], element [code]b[/code] will be after element [code]a[/code] in the array. [b]Note:[/b] you cannot randomize the return value as the heapsort algorithm expects a deterministic result. Doing so will result in unexpected behavior. [codeblock] class MyCustomSorter: