Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- ToArrayCallWithZeroLengthArrayArgument The performance of the empty array version is the same, and sometimes even better, compared to the pre-sized version. Also, passing a pre-sized array is dangerous for a concurrent or synchronized collection as a data race is possible between the <code>size</code> and <code>toArray</code> calls. This may result in extra <code>null</code>s at the end of the array if the collection was concurrently shrunk during the operation.</p> See https://shipilev.net/blog/2016/arrays-wisdom-ancients/ for more details.
- Loading branch information