partitionDedup method

(Slice<T>, Slice<T>) partitionDedup()

Moves all consecutive repeated elements to the end of the slice according to Comparable. Returns two slices. The first contains no consecutive repeated elements. The second contains all the duplicates in no specified order. If the slice is sorted, the first returned slice contains no duplicates.

Implementation

@pragma("vm:prefer-inline")
(Slice<T> dedup, Slice<T> duplicates) partitionDedup() {
  return partitionDedupBy((e0, e1) => e0 == e1);
}