@@ -41,7 +41,6 @@ import {
4141 scheduleCallback ,
4242 cancelCallback ,
4343 getCurrentPriorityLevel ,
44- runWithPriority ,
4544 shouldYield ,
4645 requestPaint ,
4746 now ,
@@ -1124,7 +1123,7 @@ export function deferredUpdates<A>(fn: () => A): A {
11241123 const previousLanePriority = getCurrentUpdateLanePriority ( ) ;
11251124 try {
11261125 setCurrentUpdateLanePriority ( DefaultLanePriority ) ;
1127- return runWithPriority ( NormalSchedulerPriority , fn ) ;
1126+ return fn ( ) ;
11281127 } finally {
11291128 setCurrentUpdateLanePriority ( previousLanePriority ) ;
11301129 }
@@ -1176,7 +1175,7 @@ export function batchedEventUpdates<A, R>(fn: A => R, a: A): R {
11761175}
11771176
11781177export function discreteUpdates < A , B , C , D , R > (
1179- fn : ( A , B , C ) = > R ,
1178+ fn : ( A , B , C , D ) = > R ,
11801179 a : A ,
11811180 b : B ,
11821181 c : C ,
@@ -1188,10 +1187,7 @@ export function discreteUpdates<A, B, C, D, R>(
11881187 const previousLanePriority = getCurrentUpdateLanePriority ( ) ;
11891188 try {
11901189 setCurrentUpdateLanePriority ( InputDiscreteLanePriority ) ;
1191- return runWithPriority (
1192- UserBlockingSchedulerPriority ,
1193- fn . bind ( null , a , b , c , d ) ,
1194- ) ;
1190+ return fn ( a , b , c , d ) ;
11951191 } finally {
11961192 setCurrentUpdateLanePriority ( previousLanePriority ) ;
11971193 executionContext = prevExecutionContext ;
@@ -1237,7 +1233,7 @@ export function flushSync<A, R>(fn: A => R, a: A): R {
12371233 try {
12381234 setCurrentUpdateLanePriority ( SyncLanePriority ) ;
12391235 if ( fn ) {
1240- return runWithPriority ( ImmediateSchedulerPriority , fn . bind ( null , a ) ) ;
1236+ return fn ( a ) ;
12411237 } else {
12421238 return ( undefined : $FlowFixMe ) ;
12431239 }
@@ -1257,7 +1253,7 @@ export function flushControlled(fn: () => mixed): void {
12571253 const previousLanePriority = getCurrentUpdateLanePriority ( ) ;
12581254 try {
12591255 setCurrentUpdateLanePriority ( SyncLanePriority ) ;
1260- runWithPriority ( ImmediateSchedulerPriority , fn ) ;
1256+ fn ( ) ;
12611257 } finally {
12621258 setCurrentUpdateLanePriority ( previousLanePriority ) ;
12631259
@@ -1753,10 +1749,7 @@ function commitRoot(root) {
17531749 const previousUpdateLanePriority = getCurrentUpdateLanePriority ( ) ;
17541750 try {
17551751 setCurrentUpdateLanePriority ( SyncLanePriority ) ;
1756- runWithPriority (
1757- ImmediateSchedulerPriority ,
1758- commitRootImpl . bind ( null , root , previousUpdateLanePriority ) ,
1759- ) ;
1752+ commitRootImpl ( root , previousUpdateLanePriority ) ;
17601753 } finally {
17611754 setCurrentUpdateLanePriority ( previousUpdateLanePriority ) ;
17621755 }
0 commit comments