@samitouri / QOS-React / commits / 3b3b7fcbbd

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

Dan Abramov committed Aug 7, 2018 at 01:59 UTC 3b3b7fcbbdc734d7f2a2e509a0b07c0eb053f779
1 file changed +5
packages/react-reconciler/src/ReactFiberScheduler.js
+5
@@ -1841,6 +1841,11 @@ function findHighestPriorityRoot() {
1841 if (root === lastScheduledRoot) {
1842 break;
1843 }
1844 + if (highestPriorityWork === Sync) {
1845 + // Sync is highest priority by definition so
1846 + // we can stop searching.
1847 + break;
1848 + }
1849 previousScheduledRoot = root;
1850 root = root.nextScheduledRoot;
1851 }