split method

Iterable<Set<T>> split(
  1. int capacity
)

Implementation

Iterable<Set<T>> split(int capacity) {
  final List<Set<T>> res = <Set<T>>[];

  int consumedCapacity = 0;
  do {
    res.add(skip(consumedCapacity).take(capacity).toSet());
    consumedCapacity += capacity;
  } while (consumedCapacity < length);

  return res;
}