resizeForCapacity method

void resizeForCapacity(
  1. int newCapacity
)

Grows every per-nid array to at least newCapacity, zero-filled (zero stamps are stale by the generation invariant). Wired into TreeController._onStoreCapacityGrew, the same lockstep protocol every other per-nid array uses.

Implementation

void resizeForCapacity(int newCapacity) {
  if (newCapacity <= _slotStamp.length) {
    return;
  }
  _parentStamp = _grownCopy(_parentStamp, newCapacity);
  _slotStamp = _grownCopy(_slotStamp, newCapacity);
  final grownIndex = Int32List(newCapacity);
  grownIndex.setRange(0, _liveIndex.length, _liveIndex);
  _liveIndex = grownIndex;
}