aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/core/src/firebase/firestore/model/field_value.cc
diff options
context:
space:
mode:
authorGravatar rsgowman <rgowman@google.com>2018-03-08 11:53:37 -0500
committerGravatar GitHub <noreply@github.com>2018-03-08 11:53:37 -0500
commit2ae36f1e9671b40723dd06462b4a416e4baa5a57 (patch)
tree0a00567da114b546d4943f9cb180797b976e18a2 /Firestore/core/src/firebase/firestore/model/field_value.cc
parentb7750b588c1d7ae9ea3891a254a39de5d3b3c572 (diff)
[De]Serialize FieldValue map_values ("Objects") (#878)
These can (recursively) contain other FieldValues.
Diffstat (limited to 'Firestore/core/src/firebase/firestore/model/field_value.cc')
-rw-r--r--Firestore/core/src/firebase/firestore/model/field_value.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/Firestore/core/src/firebase/firestore/model/field_value.cc b/Firestore/core/src/firebase/firestore/model/field_value.cc
index 03cf1d4..a38a676 100644
--- a/Firestore/core/src/firebase/firestore/model/field_value.cc
+++ b/Firestore/core/src/firebase/firestore/model/field_value.cc
@@ -113,7 +113,7 @@ FieldValue& FieldValue::operator=(const FieldValue& value) {
}
case Type::Object: {
// copy-and-swap
- std::map<const std::string, const FieldValue> tmp = value.object_value_;
+ std::map<std::string, FieldValue> tmp = value.object_value_;
std::swap(object_value_, tmp);
break;
}
@@ -281,13 +281,12 @@ FieldValue FieldValue::ArrayValue(std::vector<FieldValue>&& value) {
}
FieldValue FieldValue::ObjectValue(
- const std::map<const std::string, const FieldValue>& value) {
- std::map<const std::string, const FieldValue> copy(value);
+ const std::map<std::string, FieldValue>& value) {
+ std::map<std::string, FieldValue> copy(value);
return ObjectValue(std::move(copy));
}
-FieldValue FieldValue::ObjectValue(
- std::map<const std::string, const FieldValue>&& value) {
+FieldValue FieldValue::ObjectValue(std::map<std::string, FieldValue>&& value) {
FieldValue result;
result.SwitchTo(Type::Object);
std::swap(result.object_value_, value);
@@ -418,7 +417,7 @@ void FieldValue::SwitchTo(const Type type) {
new (&array_value_) std::vector<FieldValue>();
break;
case Type::Object:
- new (&object_value_) std::map<const std::string, const FieldValue>();
+ new (&object_value_) std::map<std::string, FieldValue>();
break;
default: {} // The other types where there is nothing to worry about.
}