Spread in Map and Set literals should use .of
constructor and addAll
methods
#49307
Labels
area-front-end
Use area-front-end for front end / CFE / kernel format related issues.
front-end-kernel-transformation
P3
A lower priority bug or feature request
The current lowering of
{...a, ...a}
has two loops.This would be better for code size if lowered to
Map.of(a)..addAll(a)
orSet.of(a)..addAll(a)
.We already do this for
List
(#44188).The VM implementation of
Map.of
/Map.addAll
has a fast path when the argument is also the default Map implementation.This is potentially faster than the current loop.
The text was updated successfully, but these errors were encountered: