-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Protobuf-backed Mutations #8040
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
Protobuf-backed Mutations #8040
Conversation
Generated by 🚫 Danger |
Sorry I'm slow with the reviews -- I'm afraid I won't be able to get to these PRs until Wednesday. If this doesn't work for you, feel free to reassign. |
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.
Sorry about the long delay!
Firestore/core/src/model/mutation.h
Outdated
#include "absl/types/optional.h" | ||
|
||
namespace firebase { | ||
namespace firestore { | ||
namespace model { | ||
|
||
class MaybeDocument; | ||
typedef std::map<FieldPath, absl::optional<google_firestore_v1_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.
Question: does the map need to be sorted?
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.
It does, as it is used as an input to SetAll. SetAll is more efficient it the input map is sorted as it processes field maps one layer at a time.
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.
SetAll is more efficient it the input map is sorted as it processes field maps one layer at a time.
Can you add this part to the comment as well?
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
Firestore/core/src/model/mutation.h
Outdated
#include "absl/types/optional.h" | ||
|
||
namespace firebase { | ||
namespace firestore { | ||
namespace model { | ||
|
||
class MaybeDocument; | ||
typedef std::map<FieldPath, absl::optional<google_firestore_v1_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.
SetAll is more efficient it the input map is sorted as it processes field maps one layer at a time.
Can you add this part to the comment as well?
I recommend comparing to Android: https://github.com/firebase/firebase-android-sdk/tree/master/firebase-firestore/src/main/java/com/google/firebase/firestore/model/mutation