parentOf method

TKey? parentOf(
  1. TKey key
)

Parent key for key, or null for roots / unregistered keys.

The parent nid slot can be null when the parent has already been freed ahead of this node in a removal sweep, so the reverse lookup must tolerate a null result.

Implementation

TKey? parentOf(TKey key) {
  final pNid = parentNidOf(key);
  return pNid == kNoParentNid ? null : nids.keyOf(pNid);
}