prune method

void prune()

Prune the cache.

This method removes the oldest buffer and destroys it.

It is used by getBuffer when size exceeds maxSize.

Implementation

void prune() {
  final f = _files.removeAt(0);
  final b = _buffers.remove(f)!;
  _size -= b.size;
  b.destroy();
}