resetToEmpty method

void resetToEmpty(
  1. int x
)

Resets the cell at x to a plain space without copying a source cell.

Implementation

void resetToEmpty(int x) {
  if (x < 0 || x >= _cells.length) return;
  final cachedHash = _renderHash;
  final cell = _cells[x];
  final previousFingerprint = cachedHash == null ? 0 : cell.renderFingerprint;
  cell.resetToEmptyCell();
  if (cachedHash != null) {
    _renderHash =
        cachedHash ^
        _slotHash(x, previousFingerprint) ^
        _slotHash(x, cell.renderFingerprint);
  }
}