Don't search beyond Sync roots for highest priority work (#13335)

This commit is contained in:
Dan Abramov authored and GitHub committed 2018-08-07 01:59:18 +01:00
1 parent 43a137d9c1
commit 3b3b7fcbbd
1 file changed
+5
+5
View File
@@ -1841,6 +1841,11 @@ function findHighestPriorityRoot() {
if (root === lastScheduledRoot) {
break;
}
if (highestPriorityWork === Sync) {
// Sync is highest priority by definition so
// we can stop searching.
break;
}
previousScheduledRoot = root;
root = root.nextScheduledRoot;
}