Skip to content

Commit

Permalink
Merge pull request #10944 from jscheel/js/add-node-to-sort-custom-docs
Browse files Browse the repository at this point in the history
Add note to Array#sort_custom about the dangers of using random values
  • Loading branch information
akien-mga committed Sep 4, 2017
2 parents b5d2d0a + 11947b4 commit 3873362
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/base/classes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5670,7 +5670,7 @@
<argument index="1" name="func" type="String">
</argument>
<description>
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.
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.
</description>
</method>
</methods>
Expand Down

0 comments on commit 3873362

Please sign in to comment.