@@ -32,7 +32,7 @@ import {
32
32
newMutationMap ,
33
33
newOverlayMap ,
34
34
documentMap ,
35
- mutableDocumentMap
35
+ mutableDocumentMap , documentKeySet
36
36
} from '../model/collections' ;
37
37
import { Document , MutableDocument } from '../model/document' ;
38
38
import { DocumentKey } from '../model/document_key' ;
@@ -116,7 +116,7 @@ export class LocalDocumentsView {
116
116
this . getLocalViewOfDocuments (
117
117
transaction ,
118
118
docs ,
119
- new SortedSet ( DocumentKey . comparator )
119
+ documentKeySet ( )
120
120
) . next ( ( ) => docs as DocumentMap )
121
121
) ;
122
122
}
@@ -209,7 +209,7 @@ export class LocalDocumentsView {
209
209
let documentsByBatchId = new SortedMap < number , DocumentKeySet > (
210
210
( key1 : number , key2 : number ) => key1 - key2
211
211
) ;
212
- let processed = new SortedSet ( DocumentKey . comparator ) ;
212
+ let processed = documentKeySet ( ) ;
213
213
return this . mutationQueue
214
214
. getAllMutationBatchesAffectingDocumentKeys ( transaction , docs )
215
215
. next ( batches => {
@@ -223,7 +223,7 @@ export class LocalDocumentsView {
223
223
if ( documentsByBatchId . get ( batch . batchId ) === null ) {
224
224
documentsByBatchId = documentsByBatchId . insert (
225
225
batch . batchId ,
226
- new SortedSet ( DocumentKey . comparator )
226
+ documentKeySet ( )
227
227
) ;
228
228
}
229
229
const newSet = documentsByBatchId . get ( batch . batchId ) ! . add ( key ) ;
@@ -394,9 +394,7 @@ export class LocalDocumentsView {
394
394
} ) ;
395
395
396
396
// Apply the overlays and match against the query.
397
- let results = new SortedMap < DocumentKey , Document > (
398
- DocumentKey . comparator
399
- ) ;
397
+ let results = documentMap ( ) ;
400
398
remoteDocuments . forEach ( ( key , document ) => {
401
399
const overlay = overlays . get ( key ) ;
402
400
if ( overlay !== undefined ) {
0 commit comments