Re:Groovy Array: it just keeps going...and going...
by nysauhem on Monday November 29, 2010 @04:33PM
(#1951868)
You could accomplish the same thing with a
public static Object[] createArray(Object... objects) {
...
}
but doing it statically, hard-coded like this is faster. You leave it to the compiler to determine the length of the arguments, rather than having to count them at run-time.
public static Object[] createArray(Object... objects) { ... }
but doing it statically, hard-coded like this is faster. You leave it to the compiler to determine the length of the arguments, rather than having to count them at run-time.
The Google Guava library does something similar, but not to this extent, only up to 12 args http://guava-libraries.googlecode.com/svn-history/r12/trunk/...