Skip to content

Commit 189e18d

Browse files
Review
1 parent 68e90dc commit 189e18d

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

packages/firestore/src/core/target.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,8 @@ export function targetGetNotInValues(
270270
break;
271271
case Operator.NOT_IN:
272272
case Operator.NOT_EQUAL:
273-
// NotIn/NotEqual is always a suffix
273+
// NotIn/NotEqual is always a suffix. There cannot be any remaining
274+
// segments and hence we can return early here.
274275
values.push(fieldFilter.value);
275276
return values;
276277
default:
@@ -284,7 +285,7 @@ export function targetGetNotInValues(
284285

285286
/**
286287
* Returns a lower bound of field values that can be used as a starting point to
287-
* scan the index defined by `fieldIndex`}`. Returns `null` if no lower bound
288+
* scan the index defined by `fieldIndex`. Returns `null` if no lower bound
288289
* exists.
289290
*/
290291
export function targetGetLowerBound(

packages/firestore/src/model/values.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -665,9 +665,7 @@ export function valuesMax(
665665
left: Value | undefined,
666666
right: Value | undefined
667667
): Value | undefined {
668-
if (left === undefined && right === undefined) {
669-
return undefined;
670-
} else if (left === undefined) {
668+
if (left === undefined) {
671669
return right;
672670
} else if (right === undefined) {
673671
return left;
@@ -680,9 +678,7 @@ export function valuesMin(
680678
left: Value | undefined,
681679
right: Value | undefined
682680
): Value | undefined {
683-
if (left === undefined && right === undefined) {
684-
return undefined;
685-
} else if (left === undefined) {
681+
if (left === undefined) {
686682
return right;
687683
} else if (right === undefined) {
688684
return left;

0 commit comments

Comments
 (0)