Skip to content

Commit d9a242d

Browse files
Better merge
1 parent b577263 commit d9a242d

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

packages/firestore/src/core/target.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,6 @@ export function targetGetLowerBound(
333333
filterValue = MIN_VALUE;
334334
break;
335335
case Operator.NOT_IN:
336-
// Porting Note: The Web SDK implements notIn queries differently from
337-
// Android and only uses a single element array as a notIn bound.
338336
filterValue = {
339337
arrayValue: { values: [MIN_VALUE] }
340338
};
@@ -419,8 +417,6 @@ export function targetGetUpperBound(
419417
filterValue = MAX_VALUE;
420418
break;
421419
case Operator.NOT_IN:
422-
// Porting Note: The Web SDK implements notIn queries differently from
423-
// Android and only uses a single element array as a notIn bound.
424420
filterValue = {
425421
arrayValue: { values: [MAX_VALUE] }
426422
};

packages/firestore/src/local/index_manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export interface IndexManager {
103103

104104
/**
105105
* Returns the documents that match the given target based on the provided
106-
* index. Returns `null` if the target does not have a matching index.
106+
* index or `null` if the target does not have a matching index.
107107
*/
108108
getDocumentsMatchingTarget(
109109
transaction: PersistenceTransaction,

packages/firestore/src/local/indexeddb_index_manager.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -426,13 +426,10 @@ export class IndexedDbIndexManager implements IndexManager {
426426
const matchingIndexes = indexes.filter(i =>
427427
targetIndexMatcher.servedByIndex(i)
428428
);
429-
if (matchingIndexes.length === 0) {
430-
return null;
431-
}
432429

433430
// Return the index that matches the most number of segments.
434431
matchingIndexes.sort((l, r) => r.fields.length - l.fields.length);
435-
return matchingIndexes[0];
432+
return matchingIndexes.length > 0 ? matchingIndexes[0] : null;
436433
});
437434
}
438435

@@ -642,8 +639,9 @@ export class IndexedDbIndexManager implements IndexManager {
642639
): PersistencePromise<void> {
643640
// Porting Note: `getFieldIndexes()` on Web does not cache index lookups as
644641
// it could be used across different IndexedDB transactions. As any cached
645-
// data might invalidated by other multi-tab clients, we can only trust data
646-
// within a single IndexedDB transaction. We therefore add a cache here.
642+
// data might be invalidated by other multi-tab clients, we can only trust
643+
// data within a single IndexedDB transaction. We therefore add a cache
644+
// here.
647645
const memoizedIndexes = new Map<string, FieldIndex[]>();
648646
return PersistencePromise.forEach(documents, (key, doc) => {
649647
const memoizedCollectionIndexes = memoizedIndexes.get(

0 commit comments

Comments
 (0)