dodrio icon indicating copy to clipboard operation
dodrio copied to clipboard

Optimize `removeSelfAndNextSiblings` op

Open fitzgen opened this issue 5 years ago • 0 comments

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.

fitzgen avatar Mar 02 '19 00:03 fitzgen