diff --git a/src/google/protobuf/any.pb.h b/src/google/protobuf/any.pb.h index c8ceb5d6e9..8aedb6bd48 100644 --- a/src/google/protobuf/any.pb.h +++ b/src/google/protobuf/any.pb.h @@ -182,11 +182,7 @@ class PROTOBUF_EXPORT Any final friend void swap(Any& a, Any& b) { a.Swap(&b); } inline void Swap(Any* other) { if (other == this) return; -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); } else { ::google::protobuf::internal::GenericSwap(this, other); diff --git a/src/google/protobuf/api.pb.h b/src/google/protobuf/api.pb.h index 644ce7d7dd..8059af8683 100644 --- a/src/google/protobuf/api.pb.h +++ b/src/google/protobuf/api.pb.h @@ -134,11 +134,7 @@ class PROTOBUF_EXPORT Mixin final friend void swap(Mixin& a, Mixin& b) { a.Swap(&b); } inline void Swap(Mixin* other) { if (other == this) return; -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); } else { ::google::protobuf::internal::GenericSwap(this, other); @@ -350,11 +346,7 @@ class PROTOBUF_EXPORT Method final friend void swap(Method& a, Method& b) { a.Swap(&b); } inline void Swap(Method* other) { if (other == this) return; -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); } else { ::google::protobuf::internal::GenericSwap(this, other); @@ -639,11 +631,7 @@ class PROTOBUF_EXPORT Api final friend void swap(Api& a, Api& b) { a.Swap(&b); } inline void Swap(Api* other) { if (other == this) return; -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); } else { ::google::protobuf::internal::GenericSwap(this, other); diff --git a/src/google/protobuf/duration.pb.h b/src/google/protobuf/duration.pb.h index 621cd43c3a..77ce0dd73f 100644 --- a/src/google/protobuf/duration.pb.h +++ b/src/google/protobuf/duration.pb.h @@ -126,11 +126,7 @@ class PROTOBUF_EXPORT Duration final friend void swap(Duration& a, Duration& b) { a.Swap(&b); } inline void Swap(Duration* other) { if (other == this) return; -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); } else { ::google::protobuf::internal::GenericSwap(this, other); diff --git a/src/google/protobuf/empty.pb.h b/src/google/protobuf/empty.pb.h index 4a7a64bb97..ab576f577f 100644 --- a/src/google/protobuf/empty.pb.h +++ b/src/google/protobuf/empty.pb.h @@ -126,11 +126,7 @@ class PROTOBUF_EXPORT Empty final friend void swap(Empty& a, Empty& b) { a.Swap(&b); } inline void Swap(Empty* other) { if (other == this) return; -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); } else { ::google::protobuf::internal::GenericSwap(this, other); diff --git a/src/google/protobuf/field_mask.pb.h b/src/google/protobuf/field_mask.pb.h index d400de2a6b..0d1fe8a975 100644 --- a/src/google/protobuf/field_mask.pb.h +++ b/src/google/protobuf/field_mask.pb.h @@ -126,11 +126,7 @@ class PROTOBUF_EXPORT FieldMask final friend void swap(FieldMask& a, FieldMask& b) { a.Swap(&b); } inline void Swap(FieldMask* other) { if (other == this) return; -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); } else { ::google::protobuf::internal::GenericSwap(this, other); diff --git a/src/google/protobuf/source_context.pb.h b/src/google/protobuf/source_context.pb.h index 7b08aa9947..c20388f9ba 100644 --- a/src/google/protobuf/source_context.pb.h +++ b/src/google/protobuf/source_context.pb.h @@ -126,11 +126,7 @@ class PROTOBUF_EXPORT SourceContext final friend void swap(SourceContext& a, SourceContext& b) { a.Swap(&b); } inline void Swap(SourceContext* other) { if (other == this) return; -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); } else { ::google::protobuf::internal::GenericSwap(this, other); diff --git a/src/google/protobuf/struct.pb.h b/src/google/protobuf/struct.pb.h index 92a345070d..6ec8bbaf3f 100644 --- a/src/google/protobuf/struct.pb.h +++ b/src/google/protobuf/struct.pb.h @@ -171,11 +171,7 @@ class PROTOBUF_EXPORT ListValue final friend void swap(ListValue& a, ListValue& b) { a.Swap(&b); } inline void Swap(ListValue* other) { if (other == this) return; -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); } else { ::google::protobuf::internal::GenericSwap(this, other); @@ -370,11 +366,7 @@ class PROTOBUF_EXPORT Struct final friend void swap(Struct& a, Struct& b) { a.Swap(&b); } inline void Swap(Struct* other) { if (other == this) return; -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); } else { ::google::protobuf::internal::GenericSwap(this, other); @@ -618,11 +610,7 @@ class PROTOBUF_EXPORT Value final friend void swap(Value& a, Value& b) { a.Swap(&b); } inline void Swap(Value* other) { if (other == this) return; -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); } else { ::google::protobuf::internal::GenericSwap(this, other); diff --git a/src/google/protobuf/timestamp.pb.h b/src/google/protobuf/timestamp.pb.h index e1d7b94422..dfcb612a2f 100644 --- a/src/google/protobuf/timestamp.pb.h +++ b/src/google/protobuf/timestamp.pb.h @@ -126,11 +126,7 @@ class PROTOBUF_EXPORT Timestamp final friend void swap(Timestamp& a, Timestamp& b) { a.Swap(&b); } inline void Swap(Timestamp* other) { if (other == this) return; -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); } else { ::google::protobuf::internal::GenericSwap(this, other); diff --git a/src/google/protobuf/type.pb.h b/src/google/protobuf/type.pb.h index 4b908eb68d..92e71a567e 100644 --- a/src/google/protobuf/type.pb.h +++ b/src/google/protobuf/type.pb.h @@ -260,11 +260,7 @@ class PROTOBUF_EXPORT Option final friend void swap(Option& a, Option& b) { a.Swap(&b); } inline void Swap(Option* other) { if (other == this) return; -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); } else { ::google::protobuf::internal::GenericSwap(this, other); @@ -476,11 +472,7 @@ class PROTOBUF_EXPORT Field final friend void swap(Field& a, Field& b) { a.Swap(&b); } inline void Swap(Field* other) { if (other == this) return; -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); } else { ::google::protobuf::internal::GenericSwap(this, other); @@ -864,11 +856,7 @@ class PROTOBUF_EXPORT EnumValue final friend void swap(EnumValue& a, EnumValue& b) { a.Swap(&b); } inline void Swap(EnumValue* other) { if (other == this) return; -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); } else { ::google::protobuf::internal::GenericSwap(this, other); @@ -1093,11 +1081,7 @@ class PROTOBUF_EXPORT Type final friend void swap(Type& a, Type& b) { a.Swap(&b); } inline void Swap(Type* other) { if (other == this) return; -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); } else { ::google::protobuf::internal::GenericSwap(this, other); @@ -1401,11 +1385,7 @@ class PROTOBUF_EXPORT Enum final friend void swap(Enum& a, Enum& b) { a.Swap(&b); } inline void Swap(Enum* other) { if (other == this) return; -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); } else { ::google::protobuf::internal::GenericSwap(this, other); diff --git a/src/google/protobuf/wrappers.pb.h b/src/google/protobuf/wrappers.pb.h index d0fd115231..59b46512a9 100644 --- a/src/google/protobuf/wrappers.pb.h +++ b/src/google/protobuf/wrappers.pb.h @@ -150,11 +150,7 @@ class PROTOBUF_EXPORT UInt64Value final friend void swap(UInt64Value& a, UInt64Value& b) { a.Swap(&b); } inline void Swap(UInt64Value* other) { if (other == this) return; -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); } else { ::google::protobuf::internal::GenericSwap(this, other); @@ -342,11 +338,7 @@ class PROTOBUF_EXPORT UInt32Value final friend void swap(UInt32Value& a, UInt32Value& b) { a.Swap(&b); } inline void Swap(UInt32Value* other) { if (other == this) return; -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); } else { ::google::protobuf::internal::GenericSwap(this, other); @@ -534,11 +526,7 @@ class PROTOBUF_EXPORT StringValue final friend void swap(StringValue& a, StringValue& b) { a.Swap(&b); } inline void Swap(StringValue* other) { if (other == this) return; -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); } else { ::google::protobuf::internal::GenericSwap(this, other); @@ -732,11 +720,7 @@ class PROTOBUF_EXPORT Int64Value final friend void swap(Int64Value& a, Int64Value& b) { a.Swap(&b); } inline void Swap(Int64Value* other) { if (other == this) return; -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); } else { ::google::protobuf::internal::GenericSwap(this, other); @@ -924,11 +908,7 @@ class PROTOBUF_EXPORT Int32Value final friend void swap(Int32Value& a, Int32Value& b) { a.Swap(&b); } inline void Swap(Int32Value* other) { if (other == this) return; -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); } else { ::google::protobuf::internal::GenericSwap(this, other); @@ -1116,11 +1096,7 @@ class PROTOBUF_EXPORT FloatValue final friend void swap(FloatValue& a, FloatValue& b) { a.Swap(&b); } inline void Swap(FloatValue* other) { if (other == this) return; -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); } else { ::google::protobuf::internal::GenericSwap(this, other); @@ -1308,11 +1284,7 @@ class PROTOBUF_EXPORT DoubleValue final friend void swap(DoubleValue& a, DoubleValue& b) { a.Swap(&b); } inline void Swap(DoubleValue* other) { if (other == this) return; -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); } else { ::google::protobuf::internal::GenericSwap(this, other); @@ -1500,11 +1472,7 @@ class PROTOBUF_EXPORT BytesValue final friend void swap(BytesValue& a, BytesValue& b) { a.Swap(&b); } inline void Swap(BytesValue* other) { if (other == this) return; -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); } else { ::google::protobuf::internal::GenericSwap(this, other); @@ -1698,11 +1666,7 @@ class PROTOBUF_EXPORT BoolValue final friend void swap(BoolValue& a, BoolValue& b) { a.Swap(&b); } inline void Swap(BoolValue* other) { if (other == this) return; -#ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && GetArena() == other->GetArena()) { -#else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { -#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); } else { ::google::protobuf::internal::GenericSwap(this, other);