diff --git a/packages/rrweb/src/record/mutation.ts b/packages/rrweb/src/record/mutation.ts index 9fde0c5fd9..377ca7be8a 100644 --- a/packages/rrweb/src/record/mutation.ts +++ b/packages/rrweb/src/record/mutation.ts @@ -132,10 +132,10 @@ class DoubleLinkedList { public defragment() { let current = this.head; while (current) { - let next = current.next; - this.removeNode(current.value); - this.addNode(current.value); - current = next; + let next = current.next; + this.removeNode(current.value); + this.addNode(current.value); + current = next; } } } @@ -378,7 +378,7 @@ export default class MutationBuffer { } let candidate: DoubleLinkedListNode | null = null; - addList.defragment() + addList.defragment(); while (addList.length) { let node: DoubleLinkedListNode | null = null; if (candidate) {