Skip to content

Commit aa3a900

Browse files
WIP
1 parent 6b8d799 commit aa3a900

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

Firestore/core/src/model/mutable_document.cc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@ namespace model {
2828
/* static */
2929
MutableDocument MutableDocument::InvalidDocument(
3030
const firebase::firestore::model::DocumentKey& document_key) {
31-
// TODO(mrschmidt): This constructor is not found
32-
MutableDocument doc{document_key, DocumentType::kInvalid,
33-
SnapshotVersion::None(), ObjectValue{},
34-
DocumentState::kSynced};
35-
return doc;
31+
return MutableDocument{document_key, DocumentType::kInvalid,
32+
SnapshotVersion::None(), ObjectValue{},
33+
DocumentState::kSynced};
3634
}
3735

3836
/* static */
@@ -52,6 +50,7 @@ MutableDocument MutableDocument::UnknownDocument(
5250
InvalidDocument(document_key).ConvertToUnknownDocument(version));
5351
}
5452

53+
/* static */
5554
MutableDocument MutableDocument::NoDocument(
5655
const firebase::firestore::model::DocumentKey& document_key,
5756
const firebase::firestore::model::SnapshotVersion& version) {
@@ -130,8 +129,8 @@ std::ostream& operator<<(std::ostream& os,
130129

131130
std::ostream& operator<<(std::ostream& os, const MutableDocument& doc) {
132131
return os << "MutableDocument(key=" << doc.key_
133-
<< ", version=" << doc.version_ << ", type=" << doc.document_type_
134-
<< ", state=" << doc.document_state_ << ", value=" << doc.value_;
132+
<< ", type=" << doc.document_type_ << ", version=" << doc.version_
133+
<< ", value=" << doc.value_ << ", state=" << doc.document_state_;
135134
}
136135

137136
} // namespace model

Firestore/core/src/model/mutable_document.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,17 @@ class MutableDocument {
8080
};
8181

8282
public:
83-
// MutableDocument contain Proto data that cannot be implicitly create or
83+
// MutableDocument contain Proto data that cannot be implicitly created or
8484
// copied.
8585
MutableDocument() = delete;
8686
MutableDocument(const MutableDocument&) = delete;
8787
MutableDocument& operator=(const MutableDocument&) = delete;
8888

8989
MutableDocument(MutableDocument&& other) noexcept
9090
: key_{std::move(other.key_)},
91+
document_type_{other.document_type_},
9192
version_{other.version_},
9293
value_{std::move(other.value_)},
93-
document_type_{other.document_type_},
9494
document_state_{other.document_state_} {
9595
}
9696

@@ -200,21 +200,21 @@ class MutableDocument {
200200

201201
private:
202202
MutableDocument(DocumentKey key,
203+
DocumentType document_type,
203204
SnapshotVersion version,
204205
ObjectValue value,
205-
DocumentType document_type,
206206
DocumentState document_state)
207207
: key_{std::move(key)},
208+
document_type_{document_type},
208209
version_{version},
209210
value_{std::move(value)},
210-
document_type_{document_type},
211211
document_state_{document_state} {
212212
}
213213

214214
DocumentKey key_;
215+
DocumentType document_type_ = DocumentType::kInvalid;
215216
SnapshotVersion version_;
216217
ObjectValue value_;
217-
DocumentType document_type_ = DocumentType::kInvalid;
218218
DocumentState document_state_ = DocumentState::kSynced;
219219
};
220220

0 commit comments

Comments
 (0)