Skip to content

Commit

Permalink
Removed obsolete exemption for closed enums
Browse files Browse the repository at this point in the history
The referenced bug was fixed long ago: https://github.com/protocolbuffers/upb/issues/541

PiperOrigin-RevId: 478870590
  • Loading branch information
haberman authored and copybara-github committed Oct 4, 2022
1 parent 32c6e9b commit 5d0833f
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions upb/reflection/field_def.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,6 @@ bool _upb_FieldDef_IsClosedEnum(const upb_FieldDef* f) {
if (UPB_TREAT_PROTO2_ENUMS_LIKE_PROTO3) return false;
if (f->type_ != kUpb_FieldType_Enum) return false;

// TODO(https://github.com/protocolbuffers/upb/issues/541):
// fix map enum values to check for unknown enum values and put
// them in the unknown field set.
if (upb_MessageDef_IsMapEntry(upb_FieldDef_ContainingType(f))) {
return false;
}

// TODO: Maybe make is_proto2 a bool at creation?
const upb_FileDef* file = upb_EnumDef_File(f->sub.enumdef);
return upb_FileDef_Syntax(file) == kUpb_Syntax_Proto2;
Expand Down

0 comments on commit 5d0833f

Please sign in to comment.