concatImmutable method

Rope concatImmutable(
  1. Rope other
)

Creates a new Rope by concatenating another Rope (immutable)

Implementation

Rope concatImmutable(Rope other) {
  if (other._root == null) return Rope._fromNode(_root, _length);
  if (_root == null) return Rope._fromNode(other._root, other._length);

  final newRoot = _concat(_root, other._root);
  return Rope._fromNode(newRoot, _length + other._length);
}