@@ -62,25 +62,25 @@ - (instancetype)initWithRemoteDocumentCache:(id<FSTRemoteDocumentCache>)remoteDo
62
62
}
63
63
64
64
- (nullable FSTMaybeDocument *)documentForKey : (const DocumentKey &)key {
65
- NSArray <FSTMutationBatch *> *affectingBatches =
65
+ NSArray <FSTMutationBatch *> *batches =
66
66
[self .mutationQueue allMutationBatchesAffectingDocumentKey: key];
67
- return [self documentForKey: key withAffectingBatches: affectingBatches ];
67
+ return [self documentForKey: key inBatches: batches ];
68
68
}
69
69
70
- // Internal version of documentForKey: which allows reusing `affectingBatches `.
70
+ // Internal version of documentForKey: which allows reusing `batches `.
71
71
- (nullable FSTMaybeDocument *)documentForKey : (const DocumentKey &)key
72
- withAffectingBatches : (NSArray <FSTMutationBatch *> *)affectingBatches {
72
+ inBatches : (NSArray <FSTMutationBatch *> *)batches {
73
73
FSTMaybeDocument *_Nullable remoteDoc = [self .remoteDocumentCache entryForKey: key];
74
- return [self localDocument: remoteDoc key: key affectingBatches: affectingBatches ];
74
+ return [self localDocument: remoteDoc key: key inBatches: batches ];
75
75
}
76
76
77
77
- (FSTMaybeDocumentDictionary *)documentsForKeys : (const DocumentKeySet &)keys {
78
78
FSTMaybeDocumentDictionary *results = [FSTMaybeDocumentDictionary maybeDocumentDictionary ];
79
- NSArray <FSTMutationBatch *> *affectingBatches =
79
+ NSArray <FSTMutationBatch *> *batches =
80
80
[self .mutationQueue allMutationBatchesAffectingDocumentKeys: keys];
81
81
for (const DocumentKey &key : keys) {
82
82
// TODO(mikelehen): PERF: Consider fetching all remote documents at once rather than one-by-one.
83
- FSTMaybeDocument *maybeDoc = [self documentForKey: key withAffectingBatches: affectingBatches ];
83
+ FSTMaybeDocument *maybeDoc = [self documentForKey: key inBatches: batches ];
84
84
// TODO(http://b/32275378): Don't conflate missing / deleted.
85
85
if (!maybeDoc) {
86
86
maybeDoc = [FSTDeletedDocument documentWithKey: key version:SnapshotVersion: :None ()];
@@ -164,8 +164,8 @@ - (FSTDocumentDictionary *)documentsMatchingCollectionQuery:(FSTQuery *)query {
164
164
*/
165
165
- (nullable FSTMaybeDocument *)localDocument : (nullable FSTMaybeDocument *)document
166
166
key : (const DocumentKey &)documentKey
167
- affectingBatches : (NSArray <FSTMutationBatch *> *)affectingBatches {
168
- for (FSTMutationBatch *batch in affectingBatches ) {
167
+ inBatches : (NSArray <FSTMutationBatch *> *)batches {
168
+ for (FSTMutationBatch *batch in batches ) {
169
169
document = [batch applyTo: document documentKey: documentKey];
170
170
}
171
171
@@ -185,14 +185,14 @@ - (FSTDocumentDictionary *)localDocuments:(FSTDocumentDictionary *)documents {
185
185
enumerateKeysAndObjectsUsingBlock: ^(FSTDocumentKey *key, FSTDocument *doc, BOOL *stop) {
186
186
keySet = keySet.insert (doc.key );
187
187
}];
188
- NSArray <FSTMutationBatch *> *affectingBatches =
188
+ NSArray <FSTMutationBatch *> *batches =
189
189
[self .mutationQueue allMutationBatchesAffectingDocumentKeys: keySet];
190
190
191
191
__block FSTDocumentDictionary *result = documents;
192
192
[documents enumerateKeysAndObjectsUsingBlock: ^(FSTDocumentKey *key, FSTDocument *remoteDocument,
193
193
BOOL *stop) {
194
194
FSTMaybeDocument *mutatedDoc =
195
- [self localDocument: remoteDocument key: key affectingBatches: affectingBatches ];
195
+ [self localDocument: remoteDocument key: key inBatches: batches ];
196
196
if ([mutatedDoc isKindOfClass: [FSTDeletedDocument class ]]) {
197
197
result = [result dictionaryByRemovingObjectForKey: key];
198
198
} else if ([mutatedDoc isKindOfClass: [FSTDocument class ]]) {
0 commit comments