Skip to content

Commit

Permalink
Don't search beyond Sync roots for highest priority work (#13335)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored Aug 7, 2018
1 parent 43a137d commit 3b3b7fc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/react-reconciler/src/ReactFiberScheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3b3b7fc

Please sign in to comment.