Immutable Arrays
New Features:
- Add
dropLastWhile
method - Add
dropLast
method - Add
dropWhile
method - Add
drop
method - Add
takeLastWhile
method - Add
takeLast
method - Add
takeWhile
method - Add
take
method - Add
filterNotNull
extension functions - Add
filterIndexed
method - Add
filterNot
method - Add
flatten
extension functions for immutable arrays, sequences, or iterables that contain nested immutable arrays - Add
filter
method - Add
immutableArrayOfNotNull
factory functions - Add
ImmutableArray<Pair<K, V>>.toMap()
extension function - Add
MutableCollection.retainAll(immutableArray)
extension function
Performance Improvements:
- Update
equals
to first check the referential equality of the backing array and immediately return without checking
the contents when they are the same backing array. - Make
toList
return the empty singleton when the size is 0, singleton-list when 1, and share the backing array when working
with generic types. - Pre-allocate a perfectly sized buffer for
partition
by populating the buffer array from both ends. - Pre-allocate a perfectly sized backing array for
flatMap
&flatMapIndexed
when operating on nested immutable
arrays.