clearNode should use replaceChildren (#157169)

The new-ish `replaceChildren` api lets us quickly remove all children of an html element without having to iterate through the children
This commit is contained in:
Matt Bierner
2022-08-04 16:05:07 -07:00
committed by GitHub
parent 5128ff1c6a
commit 85c03e0238

View File

@@ -19,9 +19,7 @@ import { withNullAsUndefined } from 'vs/base/common/types';
import { URI } from 'vs/base/common/uri';
export function clearNode(node: HTMLElement): void {
while (node.firstChild) {
node.firstChild.remove();
}
node.replaceChildren();
}
/**