On Thu, 26 Mar 2026 01:24:31 GMT, Charlie Schlosser <[email protected]> wrote:
> For example: consider the list `{B, A}`. If `A` is selected, the list of
> selected cells is `{1}`. After the sort, the new list is `{A, B}` and the
> list of selected cells is `{0}`. One item was removed, one item was added. We
> need to notify the listeners.
Good catch! I see, then we should concentrate on the optimization mostly.
> If all the items were selected, i.e. with selectAll, removed will always be
> empty since the new and old selected cells will be the same.
Maybe we could skip the event in this case. But we need to check for the case
where a developer does modify the selection in the sort operation.
> Aside: I wonder if that weak hash code implementation causes performance
> issues due to unnecessary notifications.
Feel free to change it as well! From a first look, it seems fine however (aside
not using `Objects.hash(..)`). We hash the row and the column, so it should be
fine, shouldn't it?
-------------
PR Comment: https://git.openjdk.org/jfx/pull/2100#issuecomment-4133964363