Releases: daniel-rusu/pods4k
Releases · daniel-rusu/pods4k
0.7.0
Immutable Arrays
New Features:
- Add
shuffled()&shuffled(random)methods - Add
toMutableArray()extension functions - Add
toTypedMutableArray()extension functions - Add
referencesSameArrayAs(immutableArray)method since referential equality isn't allowed for inline classes - Add
copyFrom(regularArray, startIndex, size)companion factory function - Add
randomOrNull()&randomOrNull(Random)methods - Add
random()&random(Random)methods
Performance Improvements:
- Update
filter,filterIndexed, &filterNotto switch from accumulating elements in a builder to capturing
accepted elements as single bits in anIntArrayand use bitwise operations to avoid branching. - Update
distinct()to usefilterwith aHashSetinstead of callingtoSet().toImmutableArray()to avoid using
the more expensiveLinkedHashSetwhile still maintaining original ordering. This also returns the same instance when
all elements are already distinct. - Update
immutableArrayOf(...)to avoid creating a temporary builder by using thecopyFromfactory function - Update
regularArray.toImmutableArray()to avoid creating a temporary builder by using thecopyFromfactory
function - Update
plusto concatenate an element with an Immutable Array without using builders. - Update
plusto concatenate 2 Immutable Arrays without using builders. - Update
sortedWithonImmutableArray<T>to copy the elements witharraycopy. - Update
partitionto usearraycopyto copy from the left side of the buffer.
0.6.0
Immutable Arrays
New Features:
- Add
unzipspecialization - Add
zipextension functions - Add
zipwith transform specializations - Add
distinctBymethod - Add
distinctmethod - Add
groupByextension functions - Add
associateWithextension functions - Add
associateByextension functions - Add
associateextension functions - Add
sumOfmethods
0.5.0
Immutable Arrays
New Features:
- Add
dropLastWhilemethod - Add
dropLastmethod - Add
dropWhilemethod - Add
dropmethod - Add
takeLastWhilemethod - Add
takeLastmethod - Add
takeWhilemethod - Add
takemethod - Add
filterNotNullextension functions - Add
filterIndexedmethod - Add
filterNotmethod - Add
flattenextension functions for immutable arrays, sequences, or iterables that contain nested immutable arrays - Add
filtermethod - Add
immutableArrayOfNotNullfactory functions - Add
ImmutableArray<Pair<K, V>>.toMap()extension function - Add
MutableCollection.retainAll(immutableArray)extension function
Performance Improvements:
- Update
equalsto first check the referential equality of the backing array and immediately return without checking
the contents when they are the same backing array. - Make
toListreturn 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
partitionby populating the buffer array from both ends. - Pre-allocate a perfectly sized backing array for
flatMap&flatMapIndexedwhen operating on nested immutable
arrays.
0.4.0
Immutable Arrays
Breaking Changes:
- Extracted the
asListmethod to an extension function and replaced the previous implementation, which delegated to
theasListfunction on the backing array, with a custom list implementation that's guaranteed to always be
immutable. This was necessary because the Kotlin standard libraryArray<T>.asListextension function doesn't
guarantee immutability via the wrapper list that it returns. - Renamed the
specializationspackage tomultiplicativeSpecializationsto better reflect its contents. These
specializations are generated by multiplying all combinations of base types and using the most efficient resulting
type for each combination. There are hundreds of regular non-multiplicative specializations so this updated name stops
implying that these are the only specializations that exist.
New Features:
- Add
Collection.removeAll(immutableArray)extension function - Add
Collection.containsAll(immutableArray)extension function - Add
toHashSetextension function - Add
toMutableSetextension function - Add
toSetextension function - Add
flatMapIndexedspecializations for flattening immutable arrays - Add
flatMapspecializations for flattening immutable arrays - Add
requireNoNullsextension function - Add
indexOfLast(predicate)method - Add
indexOfFirst(predicate)method - Add
joinToStringmethod - Add
lastIndexOf(element)extension function - Add
addAll(sequence)to the immutable array builders - Add
indexOf(element)extension function - Add
containsoperator
Performance Improvements:
- When converting iterables or sequences to immutable arrays, use immutable array builders instead of accumulating the
values in a temporary list as that's much more efficient.
0.3.0
Breaking Changes:
- Factory functions (like
emptyImmutableArray,immutableArrayOf,buildImmutableArray, etc.) have been moved
toImmutableArrayFactory.ktto improve code organization
New Features:
- Add
flatMapIndexedspecializations - Add
flatMapspecializations - Add
partitionmethod - Add
asListmethod - Add
MutableCollection.addAll(immutableArray)extension function - Add
+operator overload for concatenating an immutable array with an additional value - Add
+operator overload for concatenating two immutable arrays - Add
count(predicate)method - Add
none(predicate)method - Add
any(predicate)method - Add
all(predicate)method
Performance Improvements:
- Reduce the memory usage of converting immutable arrays to lists by adding all the elements in a single step
- Return
EMPTYsingleton when converting an empty regular array to an immutable array - Immutable array builders: Avoid copying the backing array when the final size matches the array size
0.2.0
Immutable Arrays
Breaking Changes:
- Extension functions
toImmutableIntArray,toImmutableFloatArray, etc. have been renamed
totoImmutableArrayso that the most efficient primitive variant is chosen by default.
New Features:
- Add
sortedByDescendingmethod - Add
sortedBymethod - Add
sortedDescendingextension functions - Add
sortedWithmethod - Add
sortedextension functions - Add
mapIndexedNotNullspecializations - Add
mapNotNullspecializations - Add dynamic factory functions (eg.
buildImmutableArray,buildImmutableBooleanArrayetc.) for when the size
isn't known in advance - Add builders for constructing immutable arrays when the size isn't known in advance
- Add
mapIndexedspecializations - Add
mapspecializations
Performance Improvements:
- Optimized
immutableArrayOffactory functions - Optimized the creation of immutable arrays from regular arrays
0.1.0
Immutable Arrays
- New: Add declaration-site variance so that a variable of type
ImmutableArray<Parent>can accept an
ImmutableArray<Child>whenChildextendsParent - New: Add
equals&hashCodemethods - New: Add Sequence
toImmutableArrayextension functions - New: Add ImmutablePrimitiveArray
toTypedImmutableArrayextension functions - New: Add generic ImmutableArray
toImmutablePrimitiveArrayextension functions - New: Add Iterable
toImmutableArrayextension functions - New: Add regular array
toImmutableArrayextension functions - New: Add
emptyImmutableArray&emptyImmutablePrimitiveArrayfactory functions - New: Add
immutableArrayOffactory functions - New: Add
singleOrNull(predicate)method - New: Add
singleOrNullmethod - New: Add
single(predicate)method - New: Add
lastOrNull(predicate)method - New: Add
firstOrNull(predicate)method - New: Add
last(predicate)method - New: Add
first(predicate)method - New: Add
withIndexmethod - New: Add
asIterablemethod - New: Add
getOrElseextension function - New: Add
lastOrNullmethod - New: Add
firstOrNullmethod - New: Add
getOrNullmethod - New: Add
toMutableListextension function - New: Add
toListmethod - New: Add
asSequencemethod - New: Add
indicesproperty - New: Add
forEachIndexedmethod - New: Add
forEachmethod - New: Add
singlemethod - New: Add
lastmethod - New: Add
firstmethod - New: Add
componentNfunctions for destructuring - New: Add
isEmpty&isNotEmptymethods - New: Add
lastIndexproperty - New: Add
toStringmethod - New: Add
iteratoroperator to allow regular for-loops - New: Add
invokefactory function - New: Create
ImmutableArray+ 8 variants for each primitive type