Description
Your Godot version:
4.4
Issue description:
If the sorting function provided to sort_custom
returns true when a == b
(E.g. using <=
instead of just <
), you will get an error that reads:
bad comparison function; sorting will be broken
The existing documentation does technically describe the correct expected behavior of the callable, but it could stand to be more explicit. I propose adding the following sentence to the main part of the method description (before the first code-example) to make the expected behavior completely unambiguous:
If the order of the two elements does not matter (E.g. they are equal), it should return
false
.
URL to the documentation page (if already existing):
https://docs.godotengine.org/en/stable/classes/class_array.html#class-array-method-sort-custom