set length()

in lib/src/queue_list.dart [162:188]


  set length(int value) {
    if (value < 0) throw RangeError('Length $value may not be negative.');
    if (value > length && null is! E) {
      throw UnsupportedError(
          'The length can only be increased when the element type is '
          'nullable, but the current element type is `$E`.');
    }

    var delta = value - length;
    if (delta >= 0) {
      if (_table.length <= value) {
        _preGrow(value);
      }
      _tail = (_tail + delta) & (_table.length - 1);
      return;
    }

    var newTail = _tail + delta; // [delta] is negative.
    if (newTail >= 0) {
      _table.fillRange(newTail, _tail, null);
    } else {
      newTail += _table.length;
      _table.fillRange(0, _tail, null);
      _table.fillRange(newTail, _table.length, null);
    }
    _tail = newTail;
  }