Skip to content

Commit

Permalink
Safe cast for number of aggregations to fix compilation warning. (#11342
Browse files Browse the repository at this point in the history
)

* Safe cast for number of aggregations to fix compilation warning.

Fixes #11332.

* Add changelog entry.
  • Loading branch information
ehsannas authored May 30, 2023
1 parent 04ce260 commit 2937104
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Firestore/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Unreleased
- [fixed] Fixed a compilation warning related to integer casting. (#11332)

# 10.9.0
- [feature] Add new cache config API to customize SDK cache settings.
- [feature] Add LRU garbage collector as an option to memory cache.
Expand Down
4 changes: 2 additions & 2 deletions Firestore/core/src/remote/remote_objc_bridge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ DatastoreSerializer::EncodeAggregateQueryRequest(
uniqueAggregates.insert(std::move(pair));
}

auto count = uniqueAggregates.size();
size_t aggregationNum = 0;
pb_size_t count = static_cast<pb_size_t>(uniqueAggregates.size());
pb_size_t aggregationNum = 0;
result->query_type.structured_aggregation_query.aggregations_count = count;
result->query_type.structured_aggregation_query.aggregations =
MakeArray<_google_firestore_v1_StructuredAggregationQuery_Aggregation>(
Expand Down

0 comments on commit 2937104

Please sign in to comment.