File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
firebase-firestore/src/main/java/com/google/firebase/firestore/core Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -170,13 +170,16 @@ public String getCanonicalId() {
170
170
171
171
@ Override
172
172
BooleanExpr toPipelineExpr () {
173
- BooleanExpr [] booleanExprs =
174
- filters .stream ().map (Filter ::toPipelineExpr ).toArray (BooleanExpr []::new );
173
+ BooleanExpr first = filters .get (0 ).toPipelineExpr ();
174
+ BooleanExpr [] additional = new BooleanExpr [filters .size () - 1 ];
175
+ for (int i = 1 , filtersSize = filters .size (); i < filtersSize ; i ++) {
176
+ additional [i - 1 ] = filters .get (i ).toPipelineExpr ();
177
+ }
175
178
switch (operator ) {
176
179
case AND :
177
- return new BooleanExpr ( " and" , booleanExprs );
180
+ return BooleanExpr . and ( first , additional );
178
181
case OR :
179
- return new BooleanExpr ( "or" , booleanExprs );
182
+ return BooleanExpr . or ( first , additional );
180
183
}
181
184
// Handle OPERATOR_UNSPECIFIED and UNRECOGNIZED cases as needed
182
185
throw new IllegalArgumentException ("Unsupported operator: " + operator );
You can’t perform that action at this time.
0 commit comments