refactor(ivy): remove superflous argument to the createTNodeAtIndex function (#32370)

PR Close #32370
This commit is contained in:
Pawel Kozlowski 2019-08-28 15:17:26 +02:00 committed by Miško Hevery
parent 97fc45f32a
commit 1bb9ce5d8c
1 changed files with 6 additions and 5 deletions

View File

@ -212,7 +212,7 @@ export function getOrCreateTNode(
// Keep this function short, so that the VM will inline it.
const adjustedIndex = index + HEADER_OFFSET;
const tNode = tView.data[adjustedIndex] as TNode ||
createTNodeAtIndex(tView, tHostNode, adjustedIndex, type, name, attrs, index);
createTNodeAtIndex(tView, tHostNode, adjustedIndex, type, name, attrs);
setPreviousOrParentTNode(tNode, true);
return tNode as TElementNode & TViewNode & TContainerNode & TElementContainerNode &
TProjectionNode & TIcuContainerNode;
@ -220,7 +220,7 @@ export function getOrCreateTNode(
function createTNodeAtIndex(
tView: TView, tHostNode: TNode | null, adjustedIndex: number, type: TNodeType,
name: string | null, attrs: TAttributes | null, index: number) {
name: string | null, attrs: TAttributes | null) {
const previousOrParentTNode = getPreviousOrParentTNode();
const isParent = getIsParent();
const parent =
@ -231,9 +231,10 @@ function createTNodeAtIndex(
const tParentNode = parentInSameView ? parent as TElementNode | TContainerNode : null;
const tNode = tView.data[adjustedIndex] =
createTNode(tView, tParentNode, type, adjustedIndex, name, attrs);
// The first node is not always the one at index 0, in case of i18n, index 0 can be the
// instruction `i18nStart` and the first node has the index 1 or more
if (index === 0 || !tView.firstChild) {
// Assign a pointer to the first child node of a given view. The first node is not always the one
// at index 0, in case of i18n, index 0 can be the instruction `i18nStart` and the first node has
// the index 1 or more, so we can't just check node index.
if (tView.firstChild === null) {
tView.firstChild = tNode;
}
if (previousOrParentTNode) {