removeWhere method

void removeWhere(
  1. bool test(
    1. T item
    )
)

Takes away those test is true of, keeping the others in order.

Implementation

void removeWhere(bool Function(T item) test) {
  var kept = 0;
  for (var i = 0; i < _length; i++) {
    final item = _items[i]!;
    if (!test(item)) _items[kept++] = item;
  }
  _items.fillRange(kept, _length, null);
  _length = kept;
}