[DOCS] Array sort

(cherry picked from commit 9115d84913)
This commit is contained in:
Max Hilbrunner 2018-05-25 16:55:56 +02:00 committed by Hein-Pieter van Braam
parent 6843ccf462
commit 8dc021925f
1 changed files with 2 additions and 2 deletions

View File

@ -274,7 +274,7 @@
</method> </method>
<method name="sort"> <method name="sort">
<description> <description>
Sort the array using natural order and return reference to the array. Sort the array using natural order.
</description> </description>
</method> </method>
<method name="sort_custom"> <method name="sort_custom">
@ -283,7 +283,7 @@
<argument index="1" name="func" type="String"> <argument index="1" name="func" type="String">
</argument> </argument>
<description> <description>
Sort the array using a custom method and return reference to the array. 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 true if the first argument is less than the second, and return false otherwise. Note: you cannot randomize the return value as the heapsort algorithm expects a deterministic result. Doing so will result in unexpected behavior. Sort 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 true if the first argument is less than the second, and return false otherwise. Note: you cannot randomize the return value as the heapsort algorithm expects a deterministic result. Doing so will result in unexpected behavior.
[codeblock] [codeblock]
class MyCustomSorter: class MyCustomSorter:
static func sort(a, b): static func sort(a, b):