Skip to content

Commit fb173fc

Browse files
committed
Nit: Check executionContext === NoContext first
In the common case it will be false and the binary expression will short circuit.
1 parent 99545d2 commit fb173fc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,8 @@ export function scheduleUpdateOnFiber(
548548
ensureRootIsScheduled(root, eventTime);
549549
schedulePendingInteractions(root, lane);
550550
if (
551-
(fiber.mode & ConcurrentMode) === NoMode &&
552-
executionContext === NoContext
551+
executionContext === NoContext &&
552+
(fiber.mode & ConcurrentMode) === NoMode
553553
) {
554554
// Flush the synchronous work now, unless we're already working or inside
555555
// a batch. This is intentionally inside scheduleUpdateOnFiber instead of

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,8 @@ export function scheduleUpdateOnFiber(
548548
ensureRootIsScheduled(root, eventTime);
549549
schedulePendingInteractions(root, lane);
550550
if (
551-
(fiber.mode & ConcurrentMode) === NoMode &&
552-
executionContext === NoContext
551+
executionContext === NoContext &&
552+
(fiber.mode & ConcurrentMode) === NoMode
553553
) {
554554
// Flush the synchronous work now, unless we're already working or inside
555555
// a batch. This is intentionally inside scheduleUpdateOnFiber instead of

0 commit comments

Comments
 (0)