From afe6521e134178920f0523ede4c715942d8f0564 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 10 Jan 2023 12:25:02 +0800 Subject: [PATCH] Refactor: remove useless parameter (#25923) ## Summary I was reading the source code of `ReactFiberLane.js` and I found the third parameter of the function markRootPinged was not used. So I think we can remove it. ## How did you test this change? There is no logic changed, so I think there is no need to add unit tests. So I run `yarn test` and `yarn test --prod` locally and all tests are passed. Co-authored-by: Jan Kassens --- packages/react-reconciler/src/ReactFiberLane.js | 6 +----- packages/react-reconciler/src/ReactFiberWorkLoop.js | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberLane.js b/packages/react-reconciler/src/ReactFiberLane.js index 42b2fc6f9a3d6..45c8810c7f477 100644 --- a/packages/react-reconciler/src/ReactFiberLane.js +++ b/packages/react-reconciler/src/ReactFiberLane.js @@ -647,11 +647,7 @@ export function markRootSuspended(root: FiberRoot, suspendedLanes: Lanes) { } } -export function markRootPinged( - root: FiberRoot, - pingedLanes: Lanes, - eventTime: number, -) { +export function markRootPinged(root: FiberRoot, pingedLanes: Lanes) { root.pingedLanes |= root.suspendedLanes & pingedLanes; } diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.js b/packages/react-reconciler/src/ReactFiberWorkLoop.js index cd9f1498c655b..264d497d8f7e9 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.js @@ -3369,7 +3369,7 @@ function pingSuspendedRoot( } const eventTime = requestEventTime(); - markRootPinged(root, pingedLanes, eventTime); + markRootPinged(root, pingedLanes); warnIfSuspenseResolutionNotWrappedWithActDEV(root);