Skip to content

Commit 3b3b7fc

Browse files
authored
Don't search beyond Sync roots for highest priority work (#13335)
1 parent 43a137d commit 3b3b7fc

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

packages/react-reconciler/src/ReactFiberScheduler.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1841,6 +1841,11 @@ function findHighestPriorityRoot() {
18411841
if (root === lastScheduledRoot) {
18421842
break;
18431843
}
1844+
if (highestPriorityWork === Sync) {
1845+
// Sync is highest priority by definition so
1846+
// we can stop searching.
1847+
break;
1848+
}
18441849
previousScheduledRoot = root;
18451850
root = root.nextScheduledRoot;
18461851
}

0 commit comments

Comments
 (0)