clone method

Fugue<T> clone()

A deep, independent copy — the basis of the immutable join.

Implementation

Fugue<T> clone() {
  final c = Fugue<T>();
  for (final b in _blocks.values) {
    final nb = _Block<T>(b.start, b.parent, b.side, List<T>.of(b.values));
    nb.deleted.addAll(b.deleted);
    c._index(nb);
  }
  return c;
}