aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/util/field_mask_util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/util/field_mask_util.cc')
-rw-r--r--src/google/protobuf/util/field_mask_util.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/google/protobuf/util/field_mask_util.cc b/src/google/protobuf/util/field_mask_util.cc
index 409010a0..9dfcbd72 100644
--- a/src/google/protobuf/util/field_mask_util.cc
+++ b/src/google/protobuf/util/field_mask_util.cc
@@ -456,11 +456,12 @@ void FieldMaskTree::TrimMessage(const Node* node, Message* message) {
const int32 field_count = descriptor->field_count();
for (int index = 0; index < field_count; ++index) {
const FieldDescriptor* field = descriptor->field(index);
- if (!ContainsKey(node->children, field->name())) {
+ map<string, Node*>::const_iterator it = node->children.find(field->name());
+ if (it == node->children.end()) {
reflection->ClearField(message, field);
} else {
if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
- Node* child = node->children.at(field->name());
+ Node* child = it->second;
if (!child->children.empty()) {
TrimMessage(child, reflection->MutableMessage(message, field));
}