dodrio
dodrio copied to clipboard
Optimize `removeSelfAndNextSiblings` op
Probably slightly faster to use lastChild
something like this:
const node = changeList.stack.pop();
const parent = node.parentNode;
let last = parent.lastChild;
while (last !== node) {
last.remove();
last = parent.lastChild;
}
// last === node
node.remove();
than how we are currently using nextSibling
.