-
Notifications
You must be signed in to change notification settings - Fork 1.6k
C++ migration: port FSTTargetChange
#2318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
if (targetChange) { | ||
for (const DocumentKey &key : targetChange.addedDocuments) { | ||
- (void)applyTargetChange:(const absl::optional<TargetChange> &)maybeTargetChange { | ||
if (maybeTargetChange.has_value()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine (and is exactly as previous). You could reverse the if statement to eliminate a level of indentation, i.e.:
if (!...) return;
...
Very optional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also prefer an early return, but other platforms follow this pattern as well. I'd rather leave as is for consistency.
modifiedDocuments:modified | ||
removedDocuments:removed]; | ||
TargetChange FSTTestTargetChangeMarkCurrent() { | ||
return {[NSData data], true, DocumentKeySet{}, DocumentKeySet{}, DocumentKeySet{}}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding named parameters for the bool and DocKeySet params. Also immediately below. Optional.
(Possibly more useful for the one below. Here, I don't know which docKeySet is which, but it doesn't matter since they're all defaulted.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
* master: (27 commits) Pass FSTMutations using a vector (#2357) Update CI to use CocoaPods 1.6.0 (#2360) Add NS_ASSUME_NONNULL_NOTATION for game center sign in (#2359) C++ migration: make all methods of `FSTRemoteStore` delegate to C++ (#2337) C++ migration: port write stream-related part of `FSTRemoteStore` (#2335) Resolve hard dependency of GameKit (#2355) Update gRPC certificate bundles locations for Firebase 5.16 (#2353) Start pod lib lint CI for IAM (#2347) Update library name to `fire-fiam`. (#2352) Bump FirebaseAnalyticsInterop version (#2315) Add IAM headless to CI (#2341) C++ migration: port watch stream-related part of `FSTRemoteStore` (#2331) Open source FIAM headless SDK (#2312) Port flaky test fix from web. (#2332) Make scripts/style.sh compatible with newer swiftformat versions (0.38) (#2334) C++ migration: port `FSTOnlineStateTracker` (#2325) Don't build fuzz tests target on Travis (#2330) Remove FSTMutationQueue (#2319) C++ migration: port `FSTRemoteEvent` (#2320) C++ migration: port `FSTTargetChange` (#2318) ...
No description provided.