Make clearNode screaming-fast-er
Reviewers: xymostech Reviewed By: xymostech Differential Revision: http://phabricator.benalpert.com/D35
This commit is contained in:
parent
8f26740010
commit
29949b500a
|
@ -87,9 +87,10 @@ var MJLite = (function() {
|
|||
};
|
||||
|
||||
var clearNode = function(node) {
|
||||
var children = node.childNodes;
|
||||
for (var i = children.length - 1; i >= 0; i--) {
|
||||
node.removeChild(children[i]);
|
||||
if ("textContent" in node) {
|
||||
node.textContent = "";
|
||||
} else {
|
||||
node.innerText = "";
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user