compact method

void compact()

Compact the queue to remove any slots that are no longer used.

The queue, using capacity slots, is reduced to length slots.

Implementation

void compact() {
  if (_length == 0) {
    _ids = Uint32List(0);
    _priorities = Float32List(0);
  } else {
    _ids = _ids.sublist(0, _length);
    _priorities = _priorities.sublist(0, _length);
  }
}