Skip to content

Commit 90a04cb

Browse files
committed
small fixes
1 parent 5bf87ae commit 90a04cb

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

packages/firestore/src/local/local_documents_view.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,9 @@ export class LocalDocumentsView {
155155
})
156156
.next(matchingMutationBatches => {
157157
for (const batch of matchingMutationBatches) {
158-
// TODO(mikelehen): PERF: Check if this mutation actually affects the
159-
// query to reduce work.
160158
for (const mutation of batch.mutations) {
161159
const key = mutation.key;
162-
160+
// Only process documents belonging to the collection.
163161
if (!query.path.isImmediateParentOf(key.path)) {
164162
continue;
165163
}

packages/firestore/src/local/mutation_queue.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,10 @@ export interface MutationQueue extends GarbageSource {
154154
): PersistencePromise<MutationBatch[]>;
155155

156156
/**
157-
* Finds all mutation batches that could possibly affect the given
158-
* set of document keys. Not all mutations in a batch will necessarily affect
159-
* each key, so when looping through the batch you'll need to
160-
* check that the mutation itself matches the key.
157+
* Finds all mutation batches that could possibly affect the given set of
158+
* document keys. Not all mutations in a batch will necessarily affect each
159+
* key, so when looping through the batch you'll need to check that the
160+
* mutation itself matches the key.
161161
*
162162
* Batches are guaranteed to be in sorted order.
163163
*

packages/firestore/test/unit/local/mutation_queue.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,6 @@ function genericMutationQueueTests(): void {
384384
const matches = await mutationQueue.getAllMutationBatchesAffectingDocumentKey(
385385
key('foo/bar')
386386
);
387-
expect(matches.length).to.deep.equal(expected.length);
388387
expectEqualArrays(matches, expected);
389388
});
390389

@@ -409,7 +408,6 @@ function genericMutationQueueTests(): void {
409408
.add(key('foo/bar'))
410409
.add(key('foo/baz'))
411410
);
412-
expect(matches.length).to.deep.equal(expected.length);
413411
expectEqualArrays(matches, expected);
414412
});
415413

0 commit comments

Comments
 (0)