prepend method

void prepend(
  1. List<String> items
)

Inserts items before the current entries (a migration splice), collapsing a duplicate that straddles the boundary (old tail == new head), then caps. A no-op when items is empty.

Implementation

void prepend(List<String> items) {
  if (items.isEmpty) return;
  _entries.insertAll(0, items);
  final boundary = items.length;
  if (boundary < _entries.length &&
      _entries[boundary - 1] == _entries[boundary]) {
    _entries.removeAt(boundary);
  }
  _cap();
}