github daniel-rusu/pods4k v0.7.0
0.7.0

5 months ago

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, & filterNot to switch from accumulating elements in a builder to capturing
    accepted elements as single bits in an IntArray and use bitwise operations to avoid branching.
  • Update distinct() to use filter with a HashSet instead of calling toSet().toImmutableArray() to avoid using
    the more expensive LinkedHashSet while 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 the copyFrom factory function
  • Update regularArray.toImmutableArray() to avoid creating a temporary builder by using the copyFrom factory
    function
  • Update plus to concatenate an element with an Immutable Array without using builders.
  • Update plus to concatenate 2 Immutable Arrays without using builders.
  • Update sortedWith on ImmutableArray<T> to copy the elements with arraycopy.
  • Update partition to use arraycopy to copy from the left side of the buffer.

Don't miss a new pods4k release

NewReleases is sending notifications on new releases.