Skip to content

Commit b538312

Browse files
Misc fixes for indexing (#6157)
* Misc fixes for indexing * Update indexeddb_index_manager.ts
1 parent 38da5d9 commit b538312

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

packages/firestore/src/local/indexeddb_index_manager.ts

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -372,23 +372,16 @@ export class IndexedDbIndexManager implements IndexManager {
372372
)
373373
: this.generateEmptyBound(indexId + 1);
374374

375-
indexRanges.push(
376-
...this.createRange(
377-
lowerBound,
378-
upperBound,
379-
notInValues.map(
380-
(
381-
notIn // make non-nullable
382-
) =>
383-
this.generateLowerBound(
384-
indexId,
385-
arrayValue,
386-
notIn,
387-
/* inclusive= */ true
388-
)
389-
)
375+
const notInBound = notInValues.map(notIn =>
376+
this.generateLowerBound(
377+
indexId,
378+
arrayValue,
379+
notIn,
380+
/* inclusive= */ true
390381
)
391382
);
383+
384+
indexRanges.push(...this.createRange(lowerBound, upperBound, notInBound));
392385
}
393386

394387
return indexRanges;
@@ -918,7 +911,7 @@ export class IndexedDbIndexManager implements IndexManager {
918911
upper: IndexEntry,
919912
notInValues: IndexEntry[]
920913
): IDBKeyRange[] {
921-
// The notIb values need to be sorted and unique so that we can return a
914+
// The notIn values need to be sorted and unique so that we can return a
922915
// sorted set of non-overlapping ranges.
923916
notInValues = notInValues
924917
.sort((l, r) => indexEntryComparator(l, r))

0 commit comments

Comments
 (0)