On Wed, 27 Mar 2024 13:41:21 GMT, Nir Lisker <nlis...@openjdk.org> wrote:

> That's still 2 iterations.

Yes, but one advantage here:
We currently do `final List<Integer> removed = new 
ArrayList<>(c.getRemovedSize());`, 
where we allocate a list with a size, that is probably too big since we filter 
the removed items.
So with `toList`, we at least get back a list with the correct size.
But true, that we technically iterate twice then. It probably does not matter 
too much.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1430#discussion_r1542147474

Reply via email to