RFR: 8283346: Optimize observable ArrayList creation in FXCollections [v3]

Marius Hanl mhanl at openjdk.org
Tue Jun 28 15:29:44 UTC 2022


On Wed, 22 Jun 2022 18:07:45 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:

>> Marius Hanl has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8283346: Improved test name
>
> modules/javafx.base/src/main/java/javafx/collections/FXCollections.java line 351:
> 
>> 349:     public static <E> ObservableList<E> observableArrayList(E... items) {
>> 350:         ObservableList<E> list = observableList(new ArrayList<>(items.length));
>> 351:         list.addAll(items);
> 
> You can also skip the generation of a list change event:
> 
> List<E> list = new ArrayList<>(items.length);
> list.addAll(items);
> return observableList(list);

done

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

PR: https://git.openjdk.org/jfx/pull/758


More information about the openjfx-dev mailing list