From b44da09c7c98ca50581d94c449553e0c0726945a Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Sun, 30 Oct 2016 22:34:55 -0700 Subject: [PATCH] Don't need defaultPriorityContext Turns out this isn't necessary. Simpler to keep it as one field. --- .../shared/fiber/ReactFiberScheduler.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/renderers/shared/fiber/ReactFiberScheduler.js b/src/renderers/shared/fiber/ReactFiberScheduler.js index f6700bacaeadd..0369677c6e4d3 100644 --- a/src/renderers/shared/fiber/ReactFiberScheduler.js +++ b/src/renderers/shared/fiber/ReactFiberScheduler.js @@ -65,9 +65,7 @@ module.exports = function(config : HostConfig) { const useSyncScheduling = config.useSyncScheduling; // The priority level to use when scheduling an update. - let priorityContext : (PriorityLevel | null) = null; - // The priority level to use if there is no priority context. - let defaultPriorityContext : PriorityLevel = useSyncScheduling ? + let priorityContext : PriorityLevel = useSyncScheduling ? SynchronousPriority : LowPriority; @@ -583,9 +581,7 @@ module.exports = function(config : HostConfig) { // We will process an update caused by each error boundary synchronously. affectedBoundaries.forEach(boundary => { - const priority = priorityContext !== null ? - priorityContext : - defaultPriorityContext; + const priority = priorityContext; const root = scheduleErrorBoundaryWork(boundary, priority); // This should use findNextUnitOfWork() when synchronous scheduling is implemented. let fiber = cloneFiber(root.current, priority); @@ -620,9 +616,7 @@ module.exports = function(config : HostConfig) { function scheduleWork(root : FiberRoot, priorityLevel : ?PriorityLevel) { if (priorityLevel == null) { - priorityLevel = priorityContext !== null ? - priorityContext : - defaultPriorityContext; + priorityLevel = priorityContext; } if (priorityLevel === SynchronousPriority) { @@ -642,9 +636,7 @@ module.exports = function(config : HostConfig) { function scheduleUpdate(fiber: Fiber, priorityLevel : ?PriorityLevel): void { // Use priority context if no priority is provided if (priorityLevel == null) { - priorityLevel = priorityContext !== null ? - priorityContext : - defaultPriorityContext; + priorityLevel = priorityContext; } while (true) {