Skip to content

Commit 0568c0f

Browse files
authored
Replace zero with NoLanes for consistency in FiberLane (#24327)
1 parent e0160d5 commit 0568c0f

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

packages/react-reconciler/src/ReactFiberLane.new.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ export function includesExpiredLane(root: FiberRoot, lanes: Lanes) {
483483
}
484484

485485
export function isTransitionLane(lane: Lane) {
486-
return (lane & TransitionLanes) !== 0;
486+
return (lane & TransitionLanes) !== NoLanes;
487487
}
488488

489489
export function claimNextTransitionLane(): Lane {
@@ -492,7 +492,7 @@ export function claimNextTransitionLane(): Lane {
492492
// run out of lanes and cycle back to the beginning.
493493
const lane = nextTransitionLane;
494494
nextTransitionLane <<= 1;
495-
if ((nextTransitionLane & TransitionLanes) === 0) {
495+
if ((nextTransitionLane & TransitionLanes) === NoLanes) {
496496
nextTransitionLane = TransitionLane1;
497497
}
498498
return lane;
@@ -501,7 +501,7 @@ export function claimNextTransitionLane(): Lane {
501501
export function claimNextRetryLane(): Lane {
502502
const lane = nextRetryLane;
503503
nextRetryLane <<= 1;
504-
if ((nextRetryLane & RetryLanes) === 0) {
504+
if ((nextRetryLane & RetryLanes) === NoLanes) {
505505
nextRetryLane = RetryLane1;
506506
}
507507
return lane;
@@ -634,8 +634,8 @@ export function markRootFinished(root: FiberRoot, remainingLanes: Lanes) {
634634
root.pendingLanes = remainingLanes;
635635

636636
// Let's try everything again
637-
root.suspendedLanes = 0;
638-
root.pingedLanes = 0;
637+
root.suspendedLanes = NoLanes;
638+
root.pingedLanes = NoLanes;
639639

640640
root.expiredLanes &= remainingLanes;
641641
root.mutableReadLanes &= remainingLanes;

packages/react-reconciler/src/ReactFiberLane.old.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ export function includesExpiredLane(root: FiberRoot, lanes: Lanes) {
483483
}
484484

485485
export function isTransitionLane(lane: Lane) {
486-
return (lane & TransitionLanes) !== 0;
486+
return (lane & TransitionLanes) !== NoLanes;
487487
}
488488

489489
export function claimNextTransitionLane(): Lane {
@@ -492,7 +492,7 @@ export function claimNextTransitionLane(): Lane {
492492
// run out of lanes and cycle back to the beginning.
493493
const lane = nextTransitionLane;
494494
nextTransitionLane <<= 1;
495-
if ((nextTransitionLane & TransitionLanes) === 0) {
495+
if ((nextTransitionLane & TransitionLanes) === NoLanes) {
496496
nextTransitionLane = TransitionLane1;
497497
}
498498
return lane;
@@ -501,7 +501,7 @@ export function claimNextTransitionLane(): Lane {
501501
export function claimNextRetryLane(): Lane {
502502
const lane = nextRetryLane;
503503
nextRetryLane <<= 1;
504-
if ((nextRetryLane & RetryLanes) === 0) {
504+
if ((nextRetryLane & RetryLanes) === NoLanes) {
505505
nextRetryLane = RetryLane1;
506506
}
507507
return lane;
@@ -634,8 +634,8 @@ export function markRootFinished(root: FiberRoot, remainingLanes: Lanes) {
634634
root.pendingLanes = remainingLanes;
635635

636636
// Let's try everything again
637-
root.suspendedLanes = 0;
638-
root.pingedLanes = 0;
637+
root.suspendedLanes = NoLanes;
638+
root.pingedLanes = NoLanes;
639639

640640
root.expiredLanes &= remainingLanes;
641641
root.mutableReadLanes &= remainingLanes;

0 commit comments

Comments
 (0)