Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 21a79a1

Browse files
trivikrAndrew Clark
authored and
Andrew Clark
committed
[schedule] Call ensureHostCallbackIsScheduled without args (facebook#13852)
ensureHostCallbackIsScheduled reads firstCallbackNode from global scope and need not be passed in function call
1 parent 9ea4bc6 commit 21a79a1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/scheduler/src/Scheduler.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ function flushFirstCallback() {
165165
} else if (nextAfterContinuation === firstCallbackNode) {
166166
// The new callback is the highest priority callback in the list.
167167
firstCallbackNode = continuationNode;
168-
ensureHostCallbackIsScheduled(firstCallbackNode);
168+
ensureHostCallbackIsScheduled();
169169
}
170170

171171
var previous = nextAfterContinuation.previous;
@@ -197,7 +197,7 @@ function flushImmediateWork() {
197197
isExecutingCallback = false;
198198
if (firstCallbackNode !== null) {
199199
// There's still work remaining. Request another callback.
200-
ensureHostCallbackIsScheduled(firstCallbackNode);
200+
ensureHostCallbackIsScheduled();
201201
} else {
202202
isHostCallbackScheduled = false;
203203
}
@@ -242,7 +242,7 @@ function flushWork(didTimeout) {
242242
isExecutingCallback = false;
243243
if (firstCallbackNode !== null) {
244244
// There's still work remaining. Request another callback.
245-
ensureHostCallbackIsScheduled(firstCallbackNode);
245+
ensureHostCallbackIsScheduled();
246246
} else {
247247
isHostCallbackScheduled = false;
248248
}
@@ -340,7 +340,7 @@ function unstable_scheduleCallback(callback, deprecated_options) {
340340
if (firstCallbackNode === null) {
341341
// This is the first callback in the list.
342342
firstCallbackNode = newNode.next = newNode.previous = newNode;
343-
ensureHostCallbackIsScheduled(firstCallbackNode);
343+
ensureHostCallbackIsScheduled();
344344
} else {
345345
var next = null;
346346
var node = firstCallbackNode;
@@ -360,7 +360,7 @@ function unstable_scheduleCallback(callback, deprecated_options) {
360360
} else if (next === firstCallbackNode) {
361361
// The new callback has the earliest expiration in the entire list.
362362
firstCallbackNode = newNode;
363-
ensureHostCallbackIsScheduled(firstCallbackNode);
363+
ensureHostCallbackIsScheduled();
364364
}
365365

366366
var previous = next.previous;

0 commit comments

Comments
 (0)