Skip to content

Commit bf405d7

Browse files
javachefacebook-github-bot
authored andcommitted
Fix definition of NativeAnimated.isEmpty
Summary: Noticed in D36098912 (facebook@5de0f14) that the definition of NativeAnimatedModule's OperationQueue.isEmpty was incorrect as it didn't account for `mPeekedOperation`, while `drainQueueIntoList` did. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D36109810 fbshipit-source-id: afd7059975ce6e5c65d1975d168a03f0881bd7c1
1 parent 8b8d732 commit bf405d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private class ConcurrentOperationQueue {
113113

114114
@AnyThread
115115
boolean isEmpty() {
116-
return mQueue.isEmpty();
116+
return mQueue.isEmpty() && mPeekedOperation != null;
117117
}
118118

119119
void setSynchronizedAccess(boolean isSynchronizedAccess) {
@@ -150,7 +150,7 @@ void executeBatch(long maxBatchNumber, NativeAnimatedNodesManager nodesManager)
150150

151151
@UiThread
152152
private @Nullable List<UIThreadOperation> drainQueueIntoList(long maxBatchNumber) {
153-
if (mQueue.isEmpty() && mPeekedOperation == null) {
153+
if (isEmpty()) {
154154
return null;
155155
}
156156

0 commit comments

Comments
 (0)