mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-06-17 02:41:49 +08:00
perf(jqLite): optimize element dealocation
Iterate only over elements and not nodes since we don't attach data or handlers to text/comment nodes.
This commit is contained in:
@@ -241,8 +241,10 @@ function jqLiteClone(element) {
|
||||
|
||||
function jqLiteDealoc(element){
|
||||
jqLiteRemoveData(element);
|
||||
for ( var i = 0, children = element.childNodes || []; i < children.length; i++) {
|
||||
jqLiteDealoc(children[i]);
|
||||
var childElement;
|
||||
for ( var i = 0, children = element.children, l = (children && children.length) || 0; i < l; i++) {
|
||||
childElement = children[i];
|
||||
jqLiteDealoc(childElement);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user