(Changed in version 2.9.0) The behavior of scanRight
has changed. The previous behavior can be reproduced with scanRight.reverse.
More efficient implementation of scala.collection.SeqLike.sortBy
More efficient implementation of scala.collection.SeqLike.sortBy
the target type of the transformation f
, and the type where
the ordering ord
is defined.
f the transformation function mapping elements
to some other domain B
.
the ordering assumed on domain B
.
a CompactBuffer consisting of the elements of this CompactBuffer
sorted according to the ordering where x < y
if
ord.lt(f(x), f(y))
.
More efficient implementation of scala.collection.SeqLike.sorted
More efficient implementation of scala.collection.SeqLike.sorted
the ordering to be used to compare elements.
a CompactBuffer consisting of the elements of this CompactBuffer
sorted according to the ordering ord
.
(Changed in version 2.9.0) transpose
throws an IllegalArgumentException
if collections are not uniformly sized.
An append-only buffer similar to ArrayBuffer, but more memory-efficient for small buffers. ArrayBuffer always allocates an Object array to store the data, with 16 entries by default, so it has about 80-100 bytes of overhead. In contrast, CompactBuffer can keep up to two elements in fields of the main object, and only allocates an Array[AnyRef] if there are more entries than that. This makes it more efficient for operations like groupBy where we expect some keys to have very few elements.