Skip to content

Commit 11dc9e9

Browse files
QueryEngine clean up (#3646)
1 parent 5f7ac45 commit 11dc9e9

File tree

1 file changed

+4
-5
lines changed
  • firebase-firestore/src/main/java/com/google/firebase/firestore/local

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
* the result set is equivalent across all implementations.
4242
*
4343
* <p>The Query engine will use indexed-based execution if a user has configured any index that can
44-
* be used to execute query (via {@link FirebaseFirestore#setIndexConfiguation}). Otherwise, the
44+
* be used to execute query (via {@link FirebaseFirestore#setIndexConfiguration}). Otherwise, the
4545
* engine will try to optimize the query by re-using a previously persisted query result. If that is
4646
* not possible, the query will be executed via a full collection scan.
4747
*
@@ -86,8 +86,7 @@ public ImmutableSortedMap<DocumentKey, Document> getDocumentsMatchingQuery(
8686
ImmutableSortedSet<DocumentKey> remoteKeys) {
8787
hardAssert(initialized, "initialize() not called");
8888

89-
ImmutableSortedMap<DocumentKey, Document> result =
90-
performQueryUsingIndex(query, query.toTarget());
89+
ImmutableSortedMap<DocumentKey, Document> result = performQueryUsingIndex(query);
9190
if (result != null) {
9291
return result;
9392
}
@@ -104,13 +103,13 @@ public ImmutableSortedMap<DocumentKey, Document> getDocumentsMatchingQuery(
104103
* Performs an indexed query that evaluates the query based on a collection's persisted index
105104
* values. Returns {@code null} if an index is not available.
106105
*/
107-
private @Nullable ImmutableSortedMap<DocumentKey, Document> performQueryUsingIndex(
108-
Query query, Target target) {
106+
private @Nullable ImmutableSortedMap<DocumentKey, Document> performQueryUsingIndex(Query query) {
109107
if (query.matchesAllDocuments()) {
110108
// Don't use index queries that can be executed by scanning the collection.
111109
return null;
112110
}
113111

112+
Target target = query.toTarget();
114113
IndexType indexType = indexManager.getIndexType(target);
115114

116115
if (indexType.equals(IndexType.NONE)) {

0 commit comments

Comments
 (0)