Skip to content

Commit e311459

Browse files
Fix build
1 parent ee377d6 commit e311459

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

Firestore/core/src/model/object_value.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ size_t CalculateSizeOfUnion(
8181
// minus the number of deleted entries.
8282
return upserts.size() +
8383
std::count_if(
84-
map_value->fields, map_value->fields + map_value->fields_count,
84+
map_value.fields, map_value.fields + map_value.fields_count,
8585
[&](const google_firestore_v1_MapValue_FieldsEntry& entry) {
8686
std::string field = MakeString(entry.key);
8787
// Don't count if entry is deleted or if it is a replacement
@@ -114,10 +114,10 @@ void ApplyChanges(
114114
// Merge the existing data with the deletes and updates
115115
for (pb_size_t source_index = 0, target_index = 0;
116116
target_index < target_count;) {
117-
if (source_index < source_count) {
118-
auto& source_entry = source_fields[source_index];
119-
auto& target_entry = target_fields[target_index];
117+
auto& source_entry = source_fields[source_index];
118+
auto& target_entry = target_fields[target_index];
120119

120+
if (source_index < source_count) {
121121
std::string source_key = MakeString(source_entry.key);
122122

123123
// Check if the source key is deleted

Firestore/core/src/nanopb/fields_array.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h"
2424
#include "Firestore/Protos/nanopb/google/firestore/v1/firestore.nanopb.h"
2525
#include "Firestore/Protos/nanopb/google/type/latlng.nanopb.h"
26+
#include "Firestore/core/src/nanopb/message.h"
2627

2728
namespace firebase {
2829
namespace firestore {
@@ -132,6 +133,12 @@ inline const pb_field_t* FieldsArray<google_firestore_v1_Value>() {
132133
return google_firestore_v1_Value_fields;
133134
}
134135

136+
template <>
137+
inline const pb_field_t*
138+
FieldsArray<google_firestore_v1_MapValue_FieldsEntry>() {
139+
return google_firestore_v1_MapValue_FieldsEntry_fields;
140+
}
141+
135142
template <>
136143
inline const pb_field_t* FieldsArray<google_firestore_v1_Write>() {
137144
return google_firestore_v1_Write_fields;

0 commit comments

Comments
 (0)