replaceWith method

void replaceWith(
  1. List<T> replacement
)

Implementation

void replaceWith(List<T> replacement) {
  var copyStart = 0;
  if (replacement.length > maxLength) {
    copyStart = replacement.length - maxLength;
  }

  final copyLength = replacement.length - copyStart;
  for (var i = 0; i < copyLength; i++) {
    _array[i] = replacement[copyStart + i];
  }

  _startIndex = 0;
  _length = copyLength;
}