Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use NoLanes to replace zero for consistency #24326

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/react-reconciler/src/ReactFiberLane.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ export function includesExpiredLane(root: FiberRoot, lanes: Lanes) {
}

export function isTransitionLane(lane: Lane) {
return (lane & TransitionLanes) !== 0;
return (lane & TransitionLanes) !== NoLanes;
}

export function claimNextTransitionLane(): Lane {
Expand All @@ -492,7 +492,7 @@ export function claimNextTransitionLane(): Lane {
// run out of lanes and cycle back to the beginning.
const lane = nextTransitionLane;
nextTransitionLane <<= 1;
if ((nextTransitionLane & TransitionLanes) === 0) {
if ((nextTransitionLane & TransitionLanes) === NoLanes) {
nextTransitionLane = TransitionLane1;
}
return lane;
Expand All @@ -501,7 +501,7 @@ export function claimNextTransitionLane(): Lane {
export function claimNextRetryLane(): Lane {
const lane = nextRetryLane;
nextRetryLane <<= 1;
if ((nextRetryLane & RetryLanes) === 0) {
if ((nextRetryLane & RetryLanes) === NoLanes) {
nextRetryLane = RetryLane1;
}
return lane;
Expand Down
6 changes: 3 additions & 3 deletions packages/react-reconciler/src/ReactFiberLane.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ export function includesExpiredLane(root: FiberRoot, lanes: Lanes) {
}

export function isTransitionLane(lane: Lane) {
return (lane & TransitionLanes) !== 0;
return (lane & TransitionLanes) !== NoLanes;
}

export function claimNextTransitionLane(): Lane {
Expand All @@ -492,7 +492,7 @@ export function claimNextTransitionLane(): Lane {
// run out of lanes and cycle back to the beginning.
const lane = nextTransitionLane;
nextTransitionLane <<= 1;
if ((nextTransitionLane & TransitionLanes) === 0) {
if ((nextTransitionLane & TransitionLanes) === NoLanes) {
nextTransitionLane = TransitionLane1;
}
return lane;
Expand All @@ -501,7 +501,7 @@ export function claimNextTransitionLane(): Lane {
export function claimNextRetryLane(): Lane {
const lane = nextRetryLane;
nextRetryLane <<= 1;
if ((nextRetryLane & RetryLanes) === 0) {
if ((nextRetryLane & RetryLanes) === NoLanes) {
nextRetryLane = RetryLane1;
}
return lane;
Expand Down