aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/util/field_mask_util.cc
diff options
context:
space:
mode:
authorFeng Xiao <xfxyjwf@gmail.com>2016-09-22 17:46:22 -0700
committerBo Yang <teboring@google.com>2016-10-10 11:44:21 -0700
commit460e7dd7c47b5a3fc290008317c044fac741916a (patch)
tree07ba6084281627598eff9afeeafe4a381bd90569 /src/google/protobuf/util/field_mask_util.cc
parent4cf072248fc39d1c63dcb1600ff9e73df8757779 (diff)
downloadprotobuf-460e7dd7c47b5a3fc290008317c044fac741916a.tar.gz
protobuf-460e7dd7c47b5a3fc290008317c044fac741916a.tar.bz2
protobuf-460e7dd7c47b5a3fc290008317c044fac741916a.zip
Fix Visual Studio compile issues.
Change-Id: I6a5078b6bcdf4637e11c1cb9da1f74298e6fc26e
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));
}