Skip to content

Commit 72c8406

Browse files
committed
Little re-arrangement.
1 parent 6d1c927 commit 72c8406

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

firebase-firestore/src/main/java/com/google/firebase/firestore/local/LocalDocumentsView.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,11 @@ Document getDocument(DocumentKey key) {
9595
if (overlay == null) {
9696
document = remoteDocumentCache.get(key);
9797
} else {
98-
if (overlay instanceof PatchMutation) {
99-
document = remoteDocumentCache.get(key);
100-
} else {
98+
// Remote document elision: avoid reading remote documents if their overlay is Set or Delete.
99+
if (overlay instanceof SetMutation || overlay instanceof DeleteMutation) {
101100
document = MutableDocument.newInvalidDocument(key);
101+
} else {
102+
document = remoteDocumentCache.get(key);
102103
}
103104
overlay.applyToLocalView(document, null, Timestamp.now());
104105
}

0 commit comments

Comments
 (0)