Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
11.1
-
None
-
None
Description
"Passing zero element array to Collection.toArray may affect performance"
This refactoring decreases performance according to https://shipilev.net/blog/2016/arrays-wisdom-ancients/
On recent VMs, collection.toArray(new T[0]) is faster than collection.toArray(new T[collection.size()]). Since it is also more readable, it should now be the preferred way of collection to array conversion.