Skip to content

Commit fdb9209

Browse files
committed
use documentKeySet() and documentMap().
1 parent f183594 commit fdb9209

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

packages/firestore/src/local/local_documents_view.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import {
3232
newMutationMap,
3333
newOverlayMap,
3434
documentMap,
35-
mutableDocumentMap
35+
mutableDocumentMap, documentKeySet
3636
} from '../model/collections';
3737
import { Document, MutableDocument } from '../model/document';
3838
import { DocumentKey } from '../model/document_key';
@@ -116,7 +116,7 @@ export class LocalDocumentsView {
116116
this.getLocalViewOfDocuments(
117117
transaction,
118118
docs,
119-
new SortedSet(DocumentKey.comparator)
119+
documentKeySet()
120120
).next(() => docs as DocumentMap)
121121
);
122122
}
@@ -209,7 +209,7 @@ export class LocalDocumentsView {
209209
let documentsByBatchId = new SortedMap<number, DocumentKeySet>(
210210
(key1: number, key2: number) => key1 - key2
211211
);
212-
let processed = new SortedSet(DocumentKey.comparator);
212+
let processed = documentKeySet();
213213
return this.mutationQueue
214214
.getAllMutationBatchesAffectingDocumentKeys(transaction, docs)
215215
.next(batches => {
@@ -223,7 +223,7 @@ export class LocalDocumentsView {
223223
if (documentsByBatchId.get(batch.batchId) === null) {
224224
documentsByBatchId = documentsByBatchId.insert(
225225
batch.batchId,
226-
new SortedSet(DocumentKey.comparator)
226+
documentKeySet()
227227
);
228228
}
229229
const newSet = documentsByBatchId.get(batch.batchId)!.add(key);
@@ -394,9 +394,7 @@ export class LocalDocumentsView {
394394
});
395395

396396
// Apply the overlays and match against the query.
397-
let results = new SortedMap<DocumentKey, Document>(
398-
DocumentKey.comparator
399-
);
397+
let results = documentMap();
400398
remoteDocuments.forEach((key, document) => {
401399
const overlay = overlays.get(key);
402400
if (overlay !== undefined) {

0 commit comments

Comments
 (0)