Skip to content

Commit dba644f

Browse files
authored
Remove usage of the proto Syntax call. (#792)
* Remove usage of the proto Syntax call. * Fix `gofmt`.
1 parent 7dd3342 commit dba644f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

protomap/proto.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,7 @@ func (m unpopRange) Range(f func(protoreflect.FieldDescriptor, protoreflect.Valu
141141
}
142142

143143
v := m.Get(fd)
144-
isProto2Scalar := fd.Syntax() == protoreflect.Proto2 && fd.Default().IsValid()
145-
isSingularMessage := fd.Cardinality() != protoreflect.Repeated && fd.Kind() == protoreflect.MessageKind
146-
if isProto2Scalar || isSingularMessage {
144+
if fd.HasPresence() {
147145
v = protoreflect.Value{} // use invalid value to emit null
148146
}
149147
if !f(fd, v) {

0 commit comments

Comments
 (0)