transform method

Delta transform(
  1. Delta other,
  2. bool priority
)

Transforms other delta against operations in this delta.

Implementation

Delta transform(Delta other, bool priority) {
  final Delta result = new Delta();
  DeltaIterator thisIter = new DeltaIterator(this);
  DeltaIterator otherIter = new DeltaIterator(other);

  while (thisIter.hasNext || otherIter.hasNext) {
    final Operation? newOp = _transformOperation(thisIter, otherIter, priority);
    if (newOp != null) result.push(newOp);
  }
  return result..trim();
}