RFR: 8301220: Return value of toArray() of Сollection types from java.base should be trusted
Glavo
duke at openjdk.org
Fri Jan 27 09:45:07 UTC 2023
On Thu, 26 Jan 2023 10:05:28 GMT, Sergey Tsypanov <stsypanov at openjdk.org> wrote:
> > it is necessary to copy the elements to a larger new array
>
> Right, I missed this is addAll() method. Btw, in this class you could do similar optimization in constructor as well.
Just now, I have pushed some updates and used similar optimizations in some places that were missed before.
-------------
PR: https://git.openjdk.org/jdk/pull/12212
More information about the core-libs-dev
mailing list