reduce method

view source

E reduce (E combine(E previousValue, E element)) inherited

Implementation

E reduce(E combine(E previousValue, E element)) {
  int length = this.length;
  if (length == 0) throw IterableElementError.noElement();
  E value = this[0];
  for (int i = 1; i < length; i++) {
    value = combine(value, this[i]);
    if (length != this.length) {
      throw ConcurrentModificationError(this);
    }
  }
  return value;
}