larsgrefer opened a new pull request #271: Use empty arrays for Collections.toArray() URL: https://github.com/apache/tomcat/pull/271 There are two styles to convert a collection to an array: either using a pre-sized array (like `c.toArray(new String[c.size()])`) or using an empty array (like `c.toArray(new String[0])`). In older Java versions using pre-sized array was recommended, as the reflection call which is necessary to create an array of proper size was quite slow. However since late updates of OpenJDK 6 this call was intrinsified, making the performance of the empty array version the same and sometimes even better, compared to the pre-sized version. See also: https://shipilev.net/blog/2016/arrays-wisdom-ancients/
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org