RFR: 8333133: Simplify QuickSort::sort
Florian Weimer
fweimer at openjdk.org
Mon Jun 17 12:56:18 UTC 2024
On Mon, 17 Jun 2024 04:48:46 GMT, David Holmes <dholmes 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.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/19464#issuecomment-2173322389
More information about the shenandoah-dev
mailing list