From fb173fc034664b96352dd2eea5ad0ca3f0da4947 Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Mon, 15 Mar 2021 22:12:04 -0500 Subject: [PATCH] Nit: Check executionContext === NoContext first In the common case it will be false and the binary expression will short circuit. --- packages/react-reconciler/src/ReactFiberWorkLoop.new.js | 4 ++-- packages/react-reconciler/src/ReactFiberWorkLoop.old.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js index fa3d4f070a2fc..19d53553f43d8 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js @@ -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 diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.old.js b/packages/react-reconciler/src/ReactFiberWorkLoop.old.js index 580258ae9d994..da22638e75758 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.old.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.old.js @@ -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