-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Pass FSTMutations* using a vector #2357
Conversation
FSTMutations*
using a vector
|
||
for (NSUInteger i = 0; i < self.mutations.count; i++) { | ||
FSTMutation *mutation = self.mutations[i]; | ||
for (int i = 0; i < _mutations.size(); i++) { |
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.
Technically, i should be unsigned. (More precisely, size_t). This will eventually become a compiler error once compiled as c++ under certain systems with the warnings that we have enabled (at least linux/gcc)
NSArray<FSTMutation *> *mutations = batch.mutations; | ||
for (NSUInteger i = 0; i < mutations.count; i++) { | ||
std::vector<FSTMutation *> mutations = batch.mutations; | ||
for (int i = 0; i < mutations.size(); i++) { |
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.
(again)
#define FSTAssertEqualVectors(v1, v2) \ | ||
do { \ | ||
XCTAssertEqual(v1.size(), v2.size(), @"Vector length mismatch"); \ | ||
for (int i = 0; i < v1.size(); i++) { \ |
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.
(again)
* 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) ...
This came up while porting
FSTTransaction
. The general idea:FSTMutationBatch
take the vector by rvalue reference, so that the vector is moved into the batch;Datastore::Commit
andWriteStream::WriteMutations
take the vector by const reference.