clearForNid method

void clearForNid(
  1. int nid
)

Per-nid cache cleanup used by the controller's adopt/release paths. Zeros both the subtree-size slot and the reverse-index slot in one call. Idempotent — safe to call on already-cleared slots. nid must be in range (callers that only have a key should resolve nid via the registry first).

Implementation

void clearForNid(int nid) {
  if (nid >= 0 && nid < _subtreeSizeByNid.length) {
    _subtreeSizeByNid[nid] = 0;
  }
  if (nid >= 0 && nid < _indexByNid.length) {
    _indexByNid[nid] = kNotVisible;
  }
}