Skip to content

Commit

Permalink
optimize selection of next addList candidate
Browse files Browse the repository at this point in the history
  • Loading branch information
mdellanoce committed Oct 31, 2023
1 parent e6e87d2 commit 9f7540d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/rrweb/src/record/mutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,13 @@ export default class MutationBuffer {
}
break;
}
candidate = node.previous;
if (node.value.previousSibling && isNodeInLinkedList(node.value.previousSibling)) {
candidate = node.value.previousSibling.__ln;
} else if (node.value.parentNode && isNodeInLinkedList(node.value.parentNode)) {
candidate = node.value.parentNode.__ln;
} else {
candidate = node.previous;
}
addList.removeNode(node.value);
pushAdd(node.value);
}
Expand Down

0 comments on commit 9f7540d

Please sign in to comment.