removeWhere method

void removeWhere(
  1. bool where(
    1. BinaryNode
    ), [
  2. bool iterator = false
])
inherited

Implementation

void removeWhere(bool Function(T) where, [bool iterator = false]) {
  if (!iterator) {
    _childrenList.removeWhere(where);
    return;
  }

  List<T> nodeList = [this as T];
  while (nodeList.isNotEmpty) {
    T first = nodeList.removeAt(0);
    first._childrenList.removeWhere(where);
    nodeList.addAll(first._childrenList);
  }
}