|
|
|
|
|
by Ajedi32
2835 days ago
|
|
No, the compare function needs to be able to indicate when two values are equal, not just when one is smaller/larger than the other. Otherwise your sort function will return inconsistent results for compare(a, b) and compare(b, a) when both values are equal. |
|
`a - b` produces the same results, so equally valid?