File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change 16
16
*/
17
17
18
18
import {
19
+ documentKeySet ,
19
20
DocumentKeySet ,
20
21
DocumentKeyToMutationMap ,
21
22
DocumentKeyToOverlayMap ,
@@ -26,7 +27,6 @@ import { Mutation } from '../model/mutation';
26
27
import { Overlay } from '../model/overlay' ;
27
28
import { ResourcePath } from '../model/path' ;
28
29
import { SortedMap } from '../util/sorted_map' ;
29
- import { SortedSet } from '../util/sorted_set' ;
30
30
31
31
import { DocumentOverlayCache } from './document_overlay_cache' ;
32
32
import { PersistencePromise } from './persistence_promise' ;
@@ -173,7 +173,7 @@ export class MemoryDocumentOverlayCache implements DocumentOverlayCache {
173
173
// Create the association of this overlay to the given largestBatchId.
174
174
let batch = this . overlayByBatchId . get ( largestBatchId ) ;
175
175
if ( batch === undefined ) {
176
- batch = new SortedSet ( DocumentKey . comparator ) ;
176
+ batch = documentKeySet ( ) ;
177
177
this . overlayByBatchId . set ( largestBatchId , batch ) ;
178
178
}
179
179
this . overlayByBatchId . set ( largestBatchId , batch . add ( mutation . key ) ) ;
Original file line number Diff line number Diff line change @@ -21,14 +21,11 @@ import { IndexedDbPersistence } from '../../../src/local/indexeddb_persistence';
21
21
import { Persistence } from '../../../src/local/persistence' ;
22
22
import {
23
23
documentKeySet ,
24
- DocumentKeySet ,
25
24
DocumentKeyToMutationMap ,
26
25
DocumentKeyToOverlayMap ,
27
26
newDocumentKeyToMutationMap
28
27
} from '../../../src/model/collections' ;
29
- import { DocumentKey } from '../../../src/model/document_key' ;
30
28
import { Mutation , mutationEquals } from '../../../src/model/mutation' ;
31
- import { SortedSet } from '../../../src/util/sorted_set' ;
32
29
import { addEqualityMatcher } from '../../util/equality_matcher' ;
33
30
import {
34
31
deleteMutation ,
@@ -124,10 +121,10 @@ function genericDocumentOverlayCacheTests(): void {
124
121
overlays : DocumentKeyToOverlayMap ,
125
122
...keys : string [ ]
126
123
) : void {
127
- const overlayKeys : DocumentKeySet = new SortedSet ( DocumentKey . comparator ) ;
128
- overlays . forEach ( overlayKey => overlayKeys . add ( overlayKey ) ) ;
129
- const expectedKeys : DocumentKeySet = new SortedSet ( DocumentKey . comparator ) ;
130
- keys . forEach ( value => expectedKeys . add ( key ( value ) ) ) ;
124
+ let overlayKeys = documentKeySet ( ) ;
125
+ overlays . forEach ( overlayKey => ( overlayKeys = overlayKeys . add ( overlayKey ) ) ) ;
126
+ let expectedKeys = documentKeySet ( ) ;
127
+ keys . forEach ( value => ( expectedKeys = expectedKeys . add ( key ( value ) ) ) ) ;
131
128
expect ( overlayKeys . isEqual ( expectedKeys ) ) . to . deep . equal ( true ) ;
132
129
}
133
130
You can’t perform that action at this time.
0 commit comments