File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
firebase-firestore/src/main/java/com/google/firebase/firestore/remote Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -654,14 +654,11 @@ StructuredAggregationQuery encodeStructuredAggregationQuery(
654
654
int aliasID = 1 ;
655
655
for (AggregateField aggregateField : aggregateFields ) {
656
656
// The code block below is used to deduplicate the same aggregate fields.
657
- // If two aggregateFields are identical, their aliases would be the same.
658
- // Therefore, when adding duplicated alias into uniqueFields, the size of uniqueFields
659
- // won't increase, and we can skip this aggregateField processing.
660
- final int count = uniqueFields .size ();
661
- uniqueFields .add (aggregateField .getAlias ());
662
- if (count == uniqueFields .size ()) {
657
+ if (uniqueFields .contains (aggregateField .getAlias ())) {
663
658
continue ;
664
659
}
660
+ uniqueFields .add (aggregateField .getAlias ());
661
+
665
662
String serverAlias = "aggregate_" + aliasID ++;
666
663
aliasMap .put (serverAlias , aggregateField .getAlias ());
667
664
You can’t perform that action at this time.
0 commit comments