Skip to content

Commit 1ca52e1

Browse files
committed
We've already got nextSibling here so can skip a step and avoid the confusing initialization to IGNORED_NODE
1 parent 0154a93 commit 1ca52e1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/rrweb/src/record/mutation.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,10 @@ export default class MutationBuffer {
287287
}
288288
}
289289

290-
let ns: Node | null = n;
291-
let nextId: number | null = IGNORED_NODE; // slimDOM: ignored
290+
let nextId = nextSibling ? this.mirror.getId(nextSibling) : null;
292291
while (nextId === IGNORED_NODE) {
293-
ns = ns && ns.nextSibling;
294-
nextId = ns && this.mirror.getId(ns);
292+
nextSibling = nextSibling && nextSibling.nextSibling;
293+
nextId = nextSibling && this.mirror.getId(nextSibling);
295294
}
296295
if (nextId === -1) {
297296
continue;

0 commit comments

Comments
 (0)