Skip to content

Commit

Permalink
Compress diffChildren further
Browse files Browse the repository at this point in the history
  • Loading branch information
jviide committed Apr 26, 2019
1 parent d676eba commit 5a9ad93
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/diff/children.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,13 @@ export function diffChildren(parentDom, newParentVNode, oldParentVNode, context,
if (oldDom == EMPTY_OBJ) {
oldDom = null;
if (excessDomChildren!=null) {
for (i = 0; i < excessDomChildren.length; i++) {
if (excessDomChildren[i]!=null) {
oldDom = excessDomChildren[i];
break;
}
for (i = 0; oldDom==null && i < excessDomChildren.length; i++) {
oldDom = excessDomChildren[i];
}
}
else {
for (i = 0; i < oldChildrenLength; i++) {
if (oldChildren[i] && oldChildren[i]._dom) {
oldDom = oldChildren[i]._dom;
break;
}
for (i = 0; oldDom==null && i < oldChildrenLength; i++) {
oldDom = oldChildren[i] && oldChildren[i]._dom;
}
}
}
Expand Down

0 comments on commit 5a9ad93

Please sign in to comment.