// Tail recursion public Replica ApplyRemote() => match(FindApplicableRemoteOp(), Some: op => Copy( opsCounter: bigint.Max(OpsCounter, op.Id.OpsCounter), document: Document.ApplyOp(op, this), processedOps: ProcessedOps.Add(op.Id)).ApplyRemote(), None: () => this);