Skip to content

Commit 8467858

Browse files
authored
Firestore: Fix build warnings in FIRFirestore.mm and set_util.h (#9987)
1 parent 850f7f7 commit 8467858

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Firestore/Source/API/FIRFirestore.mm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,9 @@ void HandleFinalStatus(const Status &status) {
340340

341341
int max_attempts = [FIRTransactionOptions defaultMaxAttempts];
342342
if (options) {
343-
max_attempts = options.maxAttempts;
343+
// Note: The cast of `maxAttempts` from `NSInteger` to `int` is safe (i.e. lossless) because
344+
// `FIRTransactionOptions` does not allow values greater than `INT32_MAX` to be set.
345+
max_attempts = static_cast<int>(options.maxAttempts);
344346
}
345347

346348
_firestore->RunTransaction(std::move(internalUpdateBlock), std::move(objcTranslator),

Firestore/core/src/util/set_util.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ namespace util {
3333
*
3434
* The method runs in O(n) where n is the size of the two lists.
3535
*
36-
* @param before - The elements that exist in the original set.
37-
* @param after - The elements to diff against the original set.
36+
* @param existing - The elements that exist in the original set.
37+
* @param new_entries - The elements to diff against the original set.
3838
* @param comparator - The comparator for the elements in before and after.
3939
* @param on_add - A function to invoke for every element that is part of `
4040
* after` but not `before`.

0 commit comments

Comments
 (0)