From b184cdd59d1f5f51962ce4e93f3235b2e3e8c541 Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Mon, 12 Feb 2024 18:09:46 +0000 Subject: [PATCH] Auto-generate files after cl/606282881 --- php/ext/google/protobuf/php-upb.c | 27 +-------------------------- php/ext/google/protobuf/php-upb.h | 5 ----- ruby/ext/google/protobuf_c/ruby-upb.c | 27 +-------------------------- ruby/ext/google/protobuf_c/ruby-upb.h | 5 ----- 4 files changed, 2 insertions(+), 62 deletions(-) diff --git a/php/ext/google/protobuf/php-upb.c b/php/ext/google/protobuf/php-upb.c index f1b1ce872a..c454b70277 100644 --- a/php/ext/google/protobuf/php-upb.c +++ b/php/ext/google/protobuf/php-upb.c @@ -5523,7 +5523,7 @@ void upb_Message_Freeze(upb_Message* msg, const upb_MiniTable* m) { } -#include +#include // Must be last. @@ -5739,31 +5739,6 @@ bool upb_Message_IsEqual(const upb_Message* msg1, const upb_Message* msg2, uf1, usize1, uf2, usize2, 100) == kUpb_UnknownCompareResult_Equal; } -bool upb_Message_IsExactlyEqual(const upb_Message* msg1, - const upb_Message* msg2, - const upb_MiniTable* m) { - if (msg1 == msg2) return true; - - int opts = kUpb_EncodeOption_SkipUnknown | kUpb_EncodeOption_Deterministic; - upb_Arena* a = upb_Arena_New(); - - // Compare deterministically serialized payloads with no unknown fields. - size_t size1, size2; - char *data1, *data2; - upb_EncodeStatus status1 = upb_Encode(msg1, m, opts, a, &data1, &size1); - upb_EncodeStatus status2 = upb_Encode(msg2, m, opts, a, &data2, &size2); - - if (status1 != kUpb_EncodeStatus_Ok || status2 != kUpb_EncodeStatus_Ok) { - // TODO: How should we fail here? (In Ruby we throw an exception.) - upb_Arena_Free(a); - return false; - } - - const bool ret = (size1 == size2) && (memcmp(data1, data2, size1) == 0); - upb_Arena_Free(a); - return ret; -} - #include #include diff --git a/php/ext/google/protobuf/php-upb.h b/php/ext/google/protobuf/php-upb.h index 7fdba63d41..95c6f717cd 100644 --- a/php/ext/google/protobuf/php-upb.h +++ b/php/ext/google/protobuf/php-upb.h @@ -12690,11 +12690,6 @@ UPB_API bool upb_Message_IsEqual(const upb_Message* msg1, const upb_Message* msg2, const upb_MiniTable* m); -// Compares two messages by serializing them and calling memcmp(). -UPB_API bool upb_Message_IsExactlyEqual(const upb_Message* msg1, - const upb_Message* msg2, - const upb_MiniTable* m); - // If |ctype| is a message then |m| must point to its minitable. UPB_API_INLINE bool upb_MessageValue_IsEqual(upb_MessageValue val1, upb_MessageValue val2, diff --git a/ruby/ext/google/protobuf_c/ruby-upb.c b/ruby/ext/google/protobuf_c/ruby-upb.c index e4c7722544..dd08e0862c 100644 --- a/ruby/ext/google/protobuf_c/ruby-upb.c +++ b/ruby/ext/google/protobuf_c/ruby-upb.c @@ -5037,7 +5037,7 @@ void upb_Message_Freeze(upb_Message* msg, const upb_MiniTable* m) { } -#include +#include // Must be last. @@ -5253,31 +5253,6 @@ bool upb_Message_IsEqual(const upb_Message* msg1, const upb_Message* msg2, uf1, usize1, uf2, usize2, 100) == kUpb_UnknownCompareResult_Equal; } -bool upb_Message_IsExactlyEqual(const upb_Message* msg1, - const upb_Message* msg2, - const upb_MiniTable* m) { - if (msg1 == msg2) return true; - - int opts = kUpb_EncodeOption_SkipUnknown | kUpb_EncodeOption_Deterministic; - upb_Arena* a = upb_Arena_New(); - - // Compare deterministically serialized payloads with no unknown fields. - size_t size1, size2; - char *data1, *data2; - upb_EncodeStatus status1 = upb_Encode(msg1, m, opts, a, &data1, &size1); - upb_EncodeStatus status2 = upb_Encode(msg2, m, opts, a, &data2, &size2); - - if (status1 != kUpb_EncodeStatus_Ok || status2 != kUpb_EncodeStatus_Ok) { - // TODO: How should we fail here? (In Ruby we throw an exception.) - upb_Arena_Free(a); - return false; - } - - const bool ret = (size1 == size2) && (memcmp(data1, data2, size1) == 0); - upb_Arena_Free(a); - return ret; -} - #include #include diff --git a/ruby/ext/google/protobuf_c/ruby-upb.h b/ruby/ext/google/protobuf_c/ruby-upb.h index 1d2ef0a553..e5d3956822 100755 --- a/ruby/ext/google/protobuf_c/ruby-upb.h +++ b/ruby/ext/google/protobuf_c/ruby-upb.h @@ -12462,11 +12462,6 @@ UPB_API bool upb_Message_IsEqual(const upb_Message* msg1, const upb_Message* msg2, const upb_MiniTable* m); -// Compares two messages by serializing them and calling memcmp(). -UPB_API bool upb_Message_IsExactlyEqual(const upb_Message* msg1, - const upb_Message* msg2, - const upb_MiniTable* m); - // If |ctype| is a message then |m| must point to its minitable. UPB_API_INLINE bool upb_MessageValue_IsEqual(upb_MessageValue val1, upb_MessageValue val2,