RFR: 8333133: Simplify QuickSort::sort

Kim Barrett kbarrett at openjdk.org
Wed Jun 26 05:21:29 UTC 2024


On Mon, 17 Jun 2024 12:53:33 GMT, Florian Weimer <fweimer at openjdk.org> wrote:

> > > It does not provide any such thing. All the flag does is prevent swapping of
> > > equivalent elements, which doesn't give us any interesting additional ordering
> > > property.
> > 
> > 
> > I only meant the sort order of the equivalent elements would be maintained.
> 
> I think the partitioning phase swaps inequal elements based on comparison with the pivot, and this can move elements equivalent to the pivot past the pivot, with or without that additional equality check.

Yes.  I think what @dholmes-ora describes is "stability", which this option does not provide.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/19464#issuecomment-2190723303


More information about the shenandoah-dev mailing list