Skip to content

Commit 5eed2a8

Browse files
Update firebase-firestore/src/main/java/com/google/firebase/firestore/local/LocalDocumentsView.java
Co-authored-by: Sebastian Schmidt <[email protected]>
1 parent 72c8406 commit 5eed2a8

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,8 @@ IndexManager getIndexManager() {
9191
*/
9292
Document getDocument(DocumentKey key) {
9393
Mutation overlay = documentOverlayCache.getOverlay(key);
94-
MutableDocument document = null;
95-
if (overlay == null) {
96-
document = remoteDocumentCache.get(key);
97-
} else {
98-
// Remote document elision: avoid reading remote documents if their overlay is Set or Delete.
99-
if (overlay instanceof SetMutation || overlay instanceof DeleteMutation) {
100-
document = MutableDocument.newInvalidDocument(key);
101-
} else {
102-
document = remoteDocumentCache.get(key);
103-
}
94+
MutableDocument document = overlay instanceof PatchMutation ?
95+
remoteDocumentCache.get(key) : MutableDocument.newInvalidDocument(key);
10496
overlay.applyToLocalView(document, null, Timestamp.now());
10597
}
10698

0 commit comments

Comments
 (0)