Ensure first iteration of performAnimationWork loop has right priority

I don't think this actually changes any behavior because of the way
findNextUnitOfWork works, but I think this is easier to follow.
This commit is contained in:
Andrew Clark committed 2016-11-02 12:40:20 -07:00
1 parent 2b26ea614d
commit ab920970ae
1 file changed
+5 -6
@@ -425,17 +425,16 @@ module.exports = function<T, P, I, TI, C>(config : HostConfig<T, P, I, TI, C>) {
// Always start from the root
nextUnitOfWork = findNextUnitOfWork();
while (nextUnitOfWork &&
nextPriorityLevel !== NoWork) {
nextPriorityLevel !== NoWork &&
nextPriorityLevel <= AnimationPriority) {
nextUnitOfWork = performUnitOfWork(nextUnitOfWork, false);
if (!nextUnitOfWork) {
// Keep searching for animation work until there's no more left
nextUnitOfWork = findNextUnitOfWork();
}
// Stop if the next unit of work is low priority
if (nextPriorityLevel > AnimationPriority) {
scheduleDeferredCallback(performDeferredWork);
return;
}
}
if (nextUnitOfWork && nextPriorityLevel > AnimationPriority) {
scheduleDeferredCallback(performDeferredWork);
}
}