From f8ea418e6a2399ac121a0067f02b679607670d4e Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Wed, 31 Jan 2024 09:53:53 -0800 Subject: [PATCH] Change Any::PackFrom to avoid bringing the full runtime. PiperOrigin-RevId: 603079735 --- src/google/protobuf/any.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/google/protobuf/any.cc b/src/google/protobuf/any.cc index d91cc81cc5..c6c914b3ac 100644 --- a/src/google/protobuf/any.cc +++ b/src/google/protobuf/any.cc @@ -25,13 +25,12 @@ bool AnyMetadata::PackFrom(Arena* arena, const Message& message) { bool AnyMetadata::PackFrom(Arena* arena, const Message& message, absl::string_view type_url_prefix) { - type_url_->Set( - GetTypeUrl(message.GetDescriptor()->full_name(), type_url_prefix), arena); + type_url_->Set(GetTypeUrl(message.GetTypeName(), type_url_prefix), arena); return message.SerializeToString(value_->Mutable(arena)); } bool AnyMetadata::UnpackTo(Message* message) const { - if (!InternalIs(message->GetDescriptor()->full_name())) { + if (!InternalIs(message->GetTypeName())) { return false; } return message->ParseFromString(value_->Get());