maxInt method

int maxInt()

Implementation

int maxInt() {
  if (isEmpty) {
    return 0;
  }
  if (length == 1) {
    return first as int;
  }

  return fold(first as int, (prev, next) => math.max(prev, next as int));
}