@samitouri / QOS-React-2 / commits / 0568c0f8cd

Replace zero with NoLanes for consistency in FiberLane (#24327)

Leo committed Apr 10, 2022 at 03:29 UTC 0568c0f8cde4ac6657dff9a5a8a7112acc35a748
2 files changed +10 -10
packages/react-reconciler/src/ReactFiberLane.new.js
+5 -5
@@ -483,7 +483,7 @@ export function includesExpiredLane(root: FiberRoot, lanes: Lanes) {
483 }
484
485 export function isTransitionLane(lane: Lane) {
486 - return (lane & TransitionLanes) !== 0;
486 + return (lane & TransitionLanes) !== NoLanes;
487 }
488
489 export function claimNextTransitionLane(): Lane {
@@ -492,7 +492,7 @@ export function claimNextTransitionLane(): Lane {
492 // run out of lanes and cycle back to the beginning.
493 const lane = nextTransitionLane;
494 nextTransitionLane <<= 1;
495 - if ((nextTransitionLane & TransitionLanes) === 0) {
495 + if ((nextTransitionLane & TransitionLanes) === NoLanes) {
496 nextTransitionLane = TransitionLane1;
497 }
498 return lane;
@@ -501,7 +501,7 @@ export function claimNextTransitionLane(): Lane {
501 export function claimNextRetryLane(): Lane {
502 const lane = nextRetryLane;
503 nextRetryLane <<= 1;
504 - if ((nextRetryLane & RetryLanes) === 0) {
504 + if ((nextRetryLane & RetryLanes) === NoLanes) {
505 nextRetryLane = RetryLane1;
506 }
507 return lane;
@@ -634,8 +634,8 @@ export function markRootFinished(root: FiberRoot, remainingLanes: Lanes) {
634 root.pendingLanes = remainingLanes;
635
636 // Let's try everything again
637 - root.suspendedLanes = 0;
638 - root.pingedLanes = 0;
637 + root.suspendedLanes = NoLanes;
638 + root.pingedLanes = NoLanes;
639
640 root.expiredLanes &= remainingLanes;
641 root.mutableReadLanes &= remainingLanes;
packages/react-reconciler/src/ReactFiberLane.old.js
+5 -5
@@ -483,7 +483,7 @@ export function includesExpiredLane(root: FiberRoot, lanes: Lanes) {
483 }
484
485 export function isTransitionLane(lane: Lane) {
486 - return (lane & TransitionLanes) !== 0;
486 + return (lane & TransitionLanes) !== NoLanes;
487 }
488
489 export function claimNextTransitionLane(): Lane {
@@ -492,7 +492,7 @@ export function claimNextTransitionLane(): Lane {
492 // run out of lanes and cycle back to the beginning.
493 const lane = nextTransitionLane;
494 nextTransitionLane <<= 1;
495 - if ((nextTransitionLane & TransitionLanes) === 0) {
495 + if ((nextTransitionLane & TransitionLanes) === NoLanes) {
496 nextTransitionLane = TransitionLane1;
497 }
498 return lane;
@@ -501,7 +501,7 @@ export function claimNextTransitionLane(): Lane {
501 export function claimNextRetryLane(): Lane {
502 const lane = nextRetryLane;
503 nextRetryLane <<= 1;
504 - if ((nextRetryLane & RetryLanes) === 0) {
504 + if ((nextRetryLane & RetryLanes) === NoLanes) {
505 nextRetryLane = RetryLane1;
506 }
507 return lane;
@@ -634,8 +634,8 @@ export function markRootFinished(root: FiberRoot, remainingLanes: Lanes) {
634 root.pendingLanes = remainingLanes;
635
636 // Let's try everything again
637 - root.suspendedLanes = 0;
638 - root.pingedLanes = 0;
637 + root.suspendedLanes = NoLanes;
638 + root.pingedLanes = NoLanes;
639
640 root.expiredLanes &= remainingLanes;
641 root.mutableReadLanes &= remainingLanes;