diff options
author | xiaofeng@google.com <xiaofeng@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2014-02-13 22:09:48 +0000 |
---|---|---|
committer | xiaofeng@google.com <xiaofeng@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2014-02-13 22:09:48 +0000 |
commit | 37c7426b4782ea01f40875b30782ab5ef0ac99b6 (patch) | |
tree | 47128be3794fb42501951e637bb9185dba96497f /src/google/protobuf/descriptor.cc | |
parent | f0b6a5cfeb5f6347c34975446bda08e0c20c9902 (diff) |
Replace kEmptyString wth OnceInit initialized string*
Diffstat (limited to 'src/google/protobuf/descriptor.cc')
-rw-r--r-- | src/google/protobuf/descriptor.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/google/protobuf/descriptor.cc b/src/google/protobuf/descriptor.cc index c941aacc..4828a592 100644 --- a/src/google/protobuf/descriptor.cc +++ b/src/google/protobuf/descriptor.cc @@ -139,8 +139,6 @@ const int FieldDescriptor::kLastReservedNumber; namespace { -const string kEmptyString; - string ToCamelCase(const string& input) { bool capitalize_next = false; string result; @@ -2757,7 +2755,7 @@ Symbol DescriptorBuilder::NewPlaceholder(const string& name, placeholder_name = tables_->AllocateString( placeholder_full_name->substr(dotpos + 1)); } else { - placeholder_package = &kEmptyString; + placeholder_package = &::google::protobuf::internal::GetEmptyString(); placeholder_name = placeholder_full_name; } @@ -2843,7 +2841,7 @@ const FileDescriptor* DescriptorBuilder::NewPlaceholderFile( memset(placeholder, 0, sizeof(*placeholder)); placeholder->name_ = tables_->AllocateString(name); - placeholder->package_ = &kEmptyString; + placeholder->package_ = &::google::protobuf::internal::GetEmptyString(); placeholder->pool_ = pool_; placeholder->options_ = &FileOptions::default_instance(); placeholder->tables_ = &FileDescriptorTables::kEmpty; @@ -3485,7 +3483,7 @@ void DescriptorBuilder::BuildFieldOrExtension(const FieldDescriptorProto& proto, result->default_value_enum_ = NULL; break; case FieldDescriptor::CPPTYPE_STRING: - result->default_value_string_ = &kEmptyString; + result->default_value_string_ = &::google::protobuf::internal::GetEmptyString(); break; case FieldDescriptor::CPPTYPE_MESSAGE: break; |