From 0400cca3236de1ca303af38bf81eab332d042b7c Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Tue, 13 Mar 2018 16:37:29 -0700 Subject: Integrated internal changes from Google --- src/google/protobuf/compiler/cpp/cpp_map_field.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/google/protobuf/compiler/cpp/cpp_map_field.cc') diff --git a/src/google/protobuf/compiler/cpp/cpp_map_field.cc b/src/google/protobuf/compiler/cpp/cpp_map_field.cc index b22c0754..0e485cac 100644 --- a/src/google/protobuf/compiler/cpp/cpp_map_field.cc +++ b/src/google/protobuf/compiler/cpp/cpp_map_field.cc @@ -104,9 +104,7 @@ void SetMessageVariables(const FieldDescriptor* descriptor, MapFieldGenerator::MapFieldGenerator(const FieldDescriptor* descriptor, const Options& options) - : FieldGenerator(options), - descriptor_(descriptor), - dependent_field_(options.proto_h && IsFieldDependent(descriptor)) { + : FieldGenerator(options), descriptor_(descriptor) { SetMessageVariables(descriptor, &variables_, options); } @@ -202,7 +200,7 @@ GenerateMergeFromCodedStream(io::Printer* printer) const { key = "entry->key()"; value = "entry->value()"; printer->Print(variables_, - "::google::protobuf::scoped_ptr<$map_classname$> entry($name$_.NewEntry());\n"); + "::std::unique_ptr<$map_classname$> entry($name$_.NewEntry());\n"); printer->Print(variables_, "{\n" " ::std::string data;\n" @@ -258,7 +256,7 @@ static void GenerateSerializationLoop(io::Printer* printer, const string& ptr, bool loop_via_iterators) { printer->Print(variables, - StrCat("::google::protobuf::scoped_ptr<$map_classname$> entry;\n", + StrCat("::std::unique_ptr<$map_classname$> entry;\n", loop_header, " {\n").c_str()); printer->Indent(); @@ -365,7 +363,7 @@ void MapFieldGenerator::GenerateSerializeWithCachedSizes( "\n" "if ($deterministic$ &&\n" " this->$name$().size() > 1) {\n" - " ::google::protobuf::scoped_array items(\n" + " ::std::unique_ptr items(\n" " new SortItem[this->$name$().size()]);\n" " typedef ::google::protobuf::Map< $key_cpp$, $val_cpp$ >::size_type size_type;\n" " size_type n = 0;\n" @@ -402,7 +400,7 @@ GenerateByteSize(io::Printer* printer) const { "total_size += $tag_size$ *\n" " ::google::protobuf::internal::FromIntSize(this->$name$_size());\n" "{\n" - " ::google::protobuf::scoped_ptr<$map_classname$> entry;\n" + " ::std::unique_ptr<$map_classname$> entry;\n" " for (::google::protobuf::Map< $key_cpp$, $val_cpp$ >::const_iterator\n" " it = this->$name$().begin();\n" " it != this->$name$().end(); ++it) {\n"); -- cgit v1.2.3