splitFirst method

(T, Slice<T>)? splitFirst()

Returns the first and all the rest of the elements of the slice, or null if it is empty.

Implementation

(T, Slice<T>)? splitFirst() {
  if (isEmpty) {
    return null;
  }
  var element = _list[_start];
  _start++;
  return (element, Slice(_list, _start, _end));
}