release method

int? release(
  1. TKey key
)

Releases the nid associated with key back to the pool and clears every dense slot. Returns the released nid, or null if key wasn't registered.

Implementation

int? release(TKey key) {
  final nid = nids.release(key);
  if (nid == null) return null;
  _dataByNid[nid] = null;
  _parentByNid[nid] = kNoParentNid;
  _childrenByNid[nid] = null;
  _depthByNid[nid] = 0;
  _expandedByNid[nid] = 0;
  _ancestorsExpandedByNid[nid] = 0;
  return nid;
}