File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ export class LocalDocumentsView {
217
217
batch . keys ( ) . forEach ( key => {
218
218
let mask : FieldMask | null = masks . has ( key )
219
219
? masks . get ( key ) !
220
- : new FieldMask ( [ ] ) ;
220
+ : FieldMask . empty ( ) ;
221
221
mask = batch . applyToLocalViewWithFieldMask ( docs . get ( key ) ! , mask ) ;
222
222
masks . set ( key , mask ) ;
223
223
if ( documentsByBatchId . get ( batch . batchId ) === null ) {
Original file line number Diff line number Diff line change @@ -42,6 +42,10 @@ export class FieldMask {
42
42
) ;
43
43
}
44
44
45
+ static empty ( ) : FieldMask {
46
+ return new FieldMask ( [ ] ) ;
47
+ }
48
+
45
49
/**
46
50
* Verifies that `fieldPath` is included by at least one field in this field
47
51
* mask.
Original file line number Diff line number Diff line change @@ -101,8 +101,7 @@ export class MutationBatch {
101
101
* @returns A `FieldMask` representing all the fields that are mutated.
102
102
*/
103
103
applyToLocalView ( document : MutableDocument ) : FieldMask | null {
104
- const mutatedFields = new FieldMask ( [ ] ) ;
105
- return this . applyToLocalViewWithFieldMask ( document , mutatedFields ) ;
104
+ return this . applyToLocalViewWithFieldMask ( document , FieldMask . empty ( ) ) ;
106
105
}
107
106
108
107
/**
You can’t perform that action at this time.
0 commit comments