Skip to content

Commit ed33a6e

Browse files
authored
Merge 4fd9d96 into a3b86c8
2 parents a3b86c8 + 4fd9d96 commit ed33a6e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

firebase-firestore/src/main/java/com/google/firebase/firestore/local/SQLiteIndexManager.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
import static java.lang.Math.max;
2424

2525
import android.text.TextUtils;
26+
import android.util.Pair;
27+
import androidx.annotation.NonNull;
2628
import androidx.annotation.Nullable;
2729
import com.google.firebase.Timestamp;
2830
import com.google.firebase.database.collection.ImmutableSortedMap;
@@ -476,13 +478,19 @@ public List<DocumentKey> getDocumentsMatchingTarget(Target target) {
476478

477479
List<String> subQueries = new ArrayList<>();
478480
List<Object> bindings = new ArrayList<>();
481+
List<Pair<Target, FieldIndex>> indexes = new ArrayList<>();
479482

480483
for (Target subTarget : getSubTargets(target)) {
481484
FieldIndex fieldIndex = getFieldIndex(subTarget);
482485
if (fieldIndex == null) {
483486
return null;
484487
}
488+
indexes.add(Pair.create(subTarget, fieldIndex));
489+
}
485490

491+
for (Pair<Target, FieldIndex> pair : indexes) {
492+
Target subTarget = pair.first;
493+
@NonNull FieldIndex fieldIndex = pair.second;
486494
@Nullable List<Value> arrayValues = subTarget.getArrayValues(fieldIndex);
487495
@Nullable Collection<Value> notInValues = subTarget.getNotInValues(fieldIndex);
488496
Bound lowerBound = subTarget.getLowerBound(fieldIndex);

0 commit comments

Comments
 (0)