|
|
|
|
|
by alex3305
1027 days ago
|
|
> I cringe every single time I see a for loop for what System.arraycopy () has been providing since early days. The worst thing is, that System.arraycopy() is an optimized JNI call which is much faster than copying it by hand [1]. > For better or worse, it shows me that the author isn't that into Java. The thing is though, most of the time arrays in Java are used because of performance. Or maybe ignorance. Because why would anyone voluntarily give up all the comforts of a List<T>? It's not that Collections are very hard to find in the documentation. And most of the IntelliJ suggest switching to a Collection anyway. 1. https://www.javaspecialists.eu/archive/Issue124-Copying-Arra... |
|