mapToGdxArray

inline fun <Type, R : Any> Iterable<Type>.mapToGdxArray(ordered: Boolean = true, initialCapacity: Int = if (this is Collection<*>) this.size else defaultArraySize, transform: (Type) -> R): GdxArray<R>

Returns a GdxArray containing the results of applying transform to each element of this iterable. Avoids the intermediate list created by map { }.toGdxArray().

Parameters

ordered

if false, methods that remove elements may change the order of other elements in the array, which avoids a memory copy.

initialCapacity

initial size of the backing array. Defaults to the collection size if known.