On Tue, 17 Mar 2026 17:40:42 GMT, Andy Goryachev <[email protected]> wrote:
>> chuckyschluz has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> minor cleanup
>
> modules/javafx.controls/src/main/java/javafx/scene/control/ControlUtils.java
> line 197:
>
>> 195: .sorted()
>> 196: .boxed()
>> 197: .toList();
>
> I wonder if using a `BitSet` would be faster because it's
> - compact
> - deduplication is nearly free
> - sorting is free
The logic for finding continguous ranges is also effortless!
private static <S> void processContiguousRanges(MultipleSelectionModelBase<S>
sm, BitSet indices, boolean isSet) {
int begin = indices.nextSetBit(0);
while (begin >= 0) {
int end = indices.nextClearBit(begin);
sm.selectedIndices.set(begin, end, isSet);
begin = indices.nextSetBit(end);
}
}
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/2100#discussion_r2950429331