toggle method

void toggle(
  1. List<T> selection
)

Toggle whether a selection is still in the storage structure.

Implementation

void toggle(List<T> selection) {
  _checkSelection(selection);
  final index = combinatorics.indexOf(selection).toInt(),
      byte = index ~/ 8,
      bit = index % 8,
      mask = 1 << bit;
  _data.setUint8(byte, _data.getUint8(byte) ^ mask);
}