Skip to content

Commit 669684a

Browse files
Tiny performance improvement in View (#87)
1 parent 98326c4 commit 669684a

File tree

1 file changed

+6
-5
lines changed
  • firebase-firestore/src/main/java/com/google/firebase/firestore/core

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,12 @@ public <D extends MaybeDocument> DocumentChanges computeDocChanges(
189189
if (!shouldWaitForSyncedDocument(oldDoc, newDoc)) {
190190
changeSet.addChange(DocumentViewChange.create(Type.MODIFIED, newDoc));
191191
changeApplied = true;
192-
}
193-
if (lastDocInLimit != null && query.comparator().compare(newDoc, lastDocInLimit) > 0) {
194-
// This doc moved from inside the limit to after the limit. That means there may be some
195-
// doc in the local cache that's actually less than this one.
196-
needsRefill = true;
192+
193+
if (lastDocInLimit != null && query.comparator().compare(newDoc, lastDocInLimit) > 0) {
194+
// This doc moved from inside the limit to after the limit. That means there may be
195+
// some doc in the local cache that's actually less than this one.
196+
needsRefill = true;
197+
}
197198
}
198199
} else if (oldDocHadPendingMutations != newDocHasPendingMutations) {
199200
changeSet.addChange(DocumentViewChange.create(Type.METADATA, newDoc));

0 commit comments

Comments
 (0)