perf(ivy): clean up createNodeAtIndex for speed (#30453)
PR Close #30453
This commit is contained in:
parent
2545445ffb
commit
9ce9561737
@ -259,9 +259,9 @@ export function createNodeAtIndex(
|
|||||||
lView[adjustedIndex] = native;
|
lView[adjustedIndex] = native;
|
||||||
|
|
||||||
const previousOrParentTNode = getPreviousOrParentTNode();
|
const previousOrParentTNode = getPreviousOrParentTNode();
|
||||||
const isParent = getIsParent();
|
|
||||||
let tNode = tView.data[adjustedIndex] as TNode;
|
let tNode = tView.data[adjustedIndex] as TNode;
|
||||||
if (tNode == null) {
|
if (tNode == null) {
|
||||||
|
const isParent = getIsParent();
|
||||||
const parent =
|
const parent =
|
||||||
isParent ? previousOrParentTNode : previousOrParentTNode && previousOrParentTNode.parent;
|
isParent ? previousOrParentTNode : previousOrParentTNode && previousOrParentTNode.parent;
|
||||||
|
|
||||||
@ -282,11 +282,10 @@ export function createNodeAtIndex(
|
|||||||
previousOrParentTNode.next = tNode;
|
previousOrParentTNode.next = tNode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if (index === 0) {
|
||||||
|
|
||||||
if (tView.firstChild == null) {
|
|
||||||
tView.firstChild = tNode;
|
tView.firstChild = tNode;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setPreviousOrParentTNode(tNode);
|
setPreviousOrParentTNode(tNode);
|
||||||
setIsParent(true);
|
setIsParent(true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user