Merge pull request #27545 from vrabaud:png

Replace deprecated proto2::FieldDescriptor::is_optional
This commit is contained in:
Alexander Smorkalov 2025-07-15 13:03:40 +03:00 committed by GitHub
commit 1342ca2f95
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -217,7 +217,7 @@ public:
const google::protobuf::UnknownFieldSet& unknownFields = msgRefl->GetUnknownFields(msg);
bool hasData = fd->is_required() ||
(fd->is_optional() && msgRefl->HasField(msg, fd)) ||
(!fd->is_repeated() && !fd->is_required() && msgRefl->HasField(msg, fd)) ||
(fd->is_repeated() && msgRefl->FieldSize(msg, fd) > 0) ||
!unknownFields.empty();
if (!hasData)