aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/arenastring.h
diff options
context:
space:
mode:
authorGravatar Feng Xiao <xfxyjwf@gmail.com>2017-03-29 14:32:48 -0700
committerGravatar Feng Xiao <xfxyjwf@gmail.com>2017-03-29 14:33:05 -0700
commitd36c0c538a545fac5d9db6ba65c525246d4efa95 (patch)
tree3fd29af0f137dfaf5df892723e60600f674392b3 /src/google/protobuf/arenastring.h
parent4a0dd03e52e09332c8fd0f8f26a8e0ae9f911182 (diff)
Down-integrate from google3.
Diffstat (limited to 'src/google/protobuf/arenastring.h')
-rwxr-xr-xsrc/google/protobuf/arenastring.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/google/protobuf/arenastring.h b/src/google/protobuf/arenastring.h
index a7efb752..63fd00e5 100755
--- a/src/google/protobuf/arenastring.h
+++ b/src/google/protobuf/arenastring.h
@@ -310,5 +310,21 @@ struct LIBPROTOBUF_EXPORT ArenaStringPtr {
+namespace protobuf {
+namespace internal {
+
+inline void ArenaStringPtr::AssignWithDefault(const ::std::string* default_value,
+ ArenaStringPtr value) {
+ const ::std::string* me = *UnsafeRawStringPointer();
+ const ::std::string* other = *value.UnsafeRawStringPointer();
+ // If the pointers are the same then do nothing.
+ if (me != other) {
+ SetNoArena(default_value, value.GetNoArena());
+ }
+}
+
+} // namespace internal
+} // namespace protobuf
+
} // namespace google
#endif // GOOGLE_PROTOBUF_ARENASTRING_H__