removeSubList method

VertexList removeSubList(
  1. VertexNode a,
  2. VertexNode b
)

Implementation

VertexList removeSubList(VertexNode a, VertexNode b) {
  if (a.prev == null) {
    head = b.next;
  } else {
    a.prev!.next = b.next;
  }

  if (b.next == null) {
    tail = a.prev;
  } else {
    b.next!.prev = a.prev;
  }

  return this;
}