Skip to content

Commit

Permalink
Nit: Check executionContext === NoContext first
Browse files Browse the repository at this point in the history
In the common case it will be false and the binary expression will
short circuit.
  • Loading branch information
acdlite committed Mar 16, 2021
1 parent 632dede commit 39ea576
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/react-reconciler/src/ReactFiberWorkLoop.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,8 @@ export function scheduleUpdateOnFiber(
ensureRootIsScheduled(root, eventTime);
schedulePendingInteractions(root, lane);
if (
(fiber.mode & ConcurrentMode) === NoMode &&
executionContext === NoContext
executionContext === NoContext &&
(fiber.mode & ConcurrentMode) === NoMode
) {
// Flush the synchronous work now, unless we're already working or inside
// a batch. This is intentionally inside scheduleUpdateOnFiber instead of
Expand Down
4 changes: 2 additions & 2 deletions packages/react-reconciler/src/ReactFiberWorkLoop.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,8 @@ export function scheduleUpdateOnFiber(
ensureRootIsScheduled(root, eventTime);
schedulePendingInteractions(root, lane);
if (
(fiber.mode & ConcurrentMode) === NoMode &&
executionContext === NoContext
executionContext === NoContext &&
(fiber.mode & ConcurrentMode) === NoMode
) {
// Flush the synchronous work now, unless we're already working or inside
// a batch. This is intentionally inside scheduleUpdateOnFiber instead of
Expand Down

0 comments on commit 39ea576

Please sign in to comment.