aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/generated_message_util.cc
diff options
context:
space:
mode:
authorGravatar xiaofeng@google.com <xiaofeng@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2014-02-13 22:09:48 +0000
committerGravatar xiaofeng@google.com <xiaofeng@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2014-02-13 22:09:48 +0000
commit37c7426b4782ea01f40875b30782ab5ef0ac99b6 (patch)
tree47128be3794fb42501951e637bb9185dba96497f /src/google/protobuf/generated_message_util.cc
parentf0b6a5cfeb5f6347c34975446bda08e0c20c9902 (diff)
Replace kEmptyString wth OnceInit initialized string*
Diffstat (limited to 'src/google/protobuf/generated_message_util.cc')
-rw-r--r--src/google/protobuf/generated_message_util.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/google/protobuf/generated_message_util.cc b/src/google/protobuf/generated_message_util.cc
index ac321501..58d6bce4 100644
--- a/src/google/protobuf/generated_message_util.cc
+++ b/src/google/protobuf/generated_message_util.cc
@@ -47,7 +47,12 @@ double NaN() {
return std::numeric_limits<double>::quiet_NaN();
}
-const ::std::string kEmptyString;
+const ::std::string* empty_string_;
+ProtobufOnceType empty_string_once_init_;
+
+void InitEmptyString() {
+ empty_string_ = new std::string;
+}
} // namespace internal
} // namespace protobuf