isFree method

bool isFree(
  1. int nid
)

Whether the slot nid is free (either out of range, or currently in the recycle pool). O(1).

Implementation

bool isFree(int nid) {
  if (nid < 0 || nid >= _nidToKey.length) {
    return true;
  }
  return _nidToKey[nid] == null;
}