Skip to content

Commit 414b86a

Browse files
SyncEngine.java: Clean up iterator usage in pumpEnqueuedLimboResolutions().
Co-authored-by: Sebastian Schmidt <[email protected]>
1 parent 2fc9656 commit 414b86a

File tree

1 file changed

+3
-2
lines changed
  • firebase-firestore/src/main/java/com/google/firebase/firestore/core

1 file changed

+3
-2
lines changed

firebase-firestore/src/main/java/com/google/firebase/firestore/core/SyncEngine.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,8 +696,9 @@ private void trackLimboChange(LimboDocumentChange change) {
696696
private void pumpEnqueuedLimboResolutions() {
697697
while (!enqueuedLimboResolutions.isEmpty()
698698
&& activeLimboTargetsByKey.size() < maxConcurrentLimboResolutions) {
699-
DocumentKey key = enqueuedLimboResolutions.iterator().next();
700-
enqueuedLimboResolutions.remove(key);
699+
Iterator<DocumentKey> it = enqueuedLimboResolutions.iterator();
700+
DocumentKey key = it.next();
701+
it.remove();
701702
int limboTargetId = targetIdGenerator.nextId();
702703
activeLimboResolutionsByTarget.put(limboTargetId, new LimboResolution(key));
703704
activeLimboTargetsByKey.put(key, limboTargetId);

0 commit comments

Comments
 (0)