Performance Enhancement: Call toArray with Zero Array Size#65
Conversation
|
Hi @DaGeRe ! I don't know if anything changed in Java 10+, but I think this is a good change, and will mark it as approved. Alas I can't merge it straight away due to the failing Travis-CI builds. I am not certain that they are related to your change, but I suspect they are not (master is broken too, but there are issues in progress working to fix it). Thanks! |
|
@kinow In Java-11, there has been an introduction to an API |
|
Thanks @namannigam . So I believe so far the overall consensus here is that the change in the pull request is OK. Let's give it some more time to wait for at least another developer to review it. |
|
Merged. Thank you very much for the pull request and sorry for the delay. |
toArray should, at least since Java 7, be used with new T[0] instead of size, since it is "faster, safer, and contractually cleaner" (https://shipilev.net/blog/2016/arrays-wisdom-ancients/#_conclusion)