Sort_by is not stable?

On Fri, Nov 19, 2010 at 2:25 AM, Michel D. [email protected]
wrote:

Just to come back to my initial post : it was not about sort, but about
sort_by.

For sort_by, you need to compute the keys, and sort the indices
according to the keys. It is not in-place sorting. Yes, optimal in-place
quicksort is unstable. But for sort_by, one could use a stable version.

We don’t distinguish between the two in JRuby, but it might be a good
trade-off to say that sort_by is stable and sort does not necessarily
have that guarantee.

  • Charlie

Charles Nutter wrote in post #966242:

… it might be a good
trade-off to say that sort_by is stable and sort does not necessarily
have that guarantee.

Yes indeed.
_md