Skip to content

Commit

Permalink
Remove unused returnFiber (#28504)
Browse files Browse the repository at this point in the history
There is no use of `returnFiber` here, it can be removed.
  • Loading branch information
bubucuo committed Mar 6, 2024
1 parent 0066e0b commit 64f354c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/react-reconciler/src/ReactChildFiber.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,6 @@ function createChildReconciler(
}

function mapRemainingChildren(
returnFiber: Fiber,
currentFirstChild: Fiber,
): Map<string | number, Fiber> {
// Add the remaining children to a temporary map so that we can find them by
Expand Down Expand Up @@ -1194,7 +1193,7 @@ function createChildReconciler(
}

// Add all children to a key map for quick lookups.
const existingChildren = mapRemainingChildren(returnFiber, oldFiber);
const existingChildren = mapRemainingChildren(oldFiber);

// Keep scanning and use the map to restore deleted items as moves.
for (; newIdx < newChildren.length; newIdx++) {
Expand Down Expand Up @@ -1404,7 +1403,7 @@ function createChildReconciler(
}

// Add all children to a key map for quick lookups.
const existingChildren = mapRemainingChildren(returnFiber, oldFiber);
const existingChildren = mapRemainingChildren(oldFiber);

// Keep scanning and use the map to restore deleted items as moves.
for (; !step.done; newIdx++, step = newChildren.next()) {
Expand Down

0 comments on commit 64f354c

Please sign in to comment.