use reverse loop with deletions
This commit is contained in:
parent
42a33b074c
commit
f28ae323c5
8 changed files with 9 additions and 7 deletions
|
|
@ -161,7 +161,7 @@ Mithril = m = new function app(window) {
|
|||
return cachedAttrs
|
||||
}
|
||||
function clear(nodes) {
|
||||
for (var i = 0; i < nodes.length; i++) nodes[i].parentNode.removeChild(nodes[i])
|
||||
for (var i = nodes.length - 1; i > -1; i--) nodes[i].parentNode.removeChild(nodes[i])
|
||||
nodes.length = 0
|
||||
}
|
||||
function injectHTML(parentElement, index, data) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue