989
return;
990
}
992
>
const nodesToDel: TreeNode[] = [];
993
>
994
>
const startSplitPosInBuffer = this.positionInBuffer(startNode, startPosition.remainder);
995
>
this.deleteNodeTail(startNode, startSplitPosInBuffer);
996
>
this._searchCache.validate(offset);
997
>
if (startNode.piece.length === 0) {
998
nodesToDel.push(startNode);
999
}
1001
>
// update last touched node
1002
>
const endSplitPosInBuffer = this.positionInBuffer(endNode, endPosition.remainder);
1003
>
this.deleteNodeHead(endNode, endSplitPosInBuffer);
1004
>
if (endNode.piece.length === 0) {
1005
nodesToDel.push(endNode);
1006
}
1008
>
// delete nodes in between
1009
>
const secondNode = startNode.next();
1010
for (let node = secondNode; node !== SENTINEL && node !== endNode; node = node.next()) {
1011
nodesToDel.push(node);
1012
}
1014
const prev = startNode.piece.length === 0 ? startNode.prev() : startNode;
1015
this.deleteNodes(nodesToDel);