clearForNid method

void clearForNid(
  1. int nid
)

Defensive slot reset for the nid adopt and release paths. Bounds-checked because those can run before resizeForCapacity has grown this engine's array to cover nid.

Implementation

void clearForNid(int nid) {
  if (nid < 0 || nid >= _slideByNid.length) return;
  final prev = _slideByNid[nid];
  if (prev != null) {
    if (prev.startDeltaX != 0.0) _xActiveCount--;
    _slideByNid[nid] = null;
    _activeSlideNids.remove(nid);
  }
}