deleteKeys method

void deleteKeys(
  1. List<int> indices
)

Removes the keys at indices. Sorted and walked back to front internally, so an earlier removal never shifts a later index still waiting to be read — the caller hands over indices into the table as it was before this call, in whatever order it likes.

Implementation

void deleteKeys(List<int> indices) {
  final sorted = List<int>.of(indices)..sort();
  for (var i = sorted.length - 1; i >= 0; i--) {
    final index = sorted[i];
    if (index < 0 || index >= _keys.length) continue;
    _keys.removeAt(index);
  }
}