Skip to content

Commit

Permalink
Remove usage of the proto Syntax call. (#792)
Browse files Browse the repository at this point in the history
* Remove usage of the proto Syntax call.

* Fix `gofmt`.
  • Loading branch information
robshakir authored Mar 10, 2023
1 parent 7dd3342 commit dba644f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions protomap/proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ func (m unpopRange) Range(f func(protoreflect.FieldDescriptor, protoreflect.Valu
}

v := m.Get(fd)
isProto2Scalar := fd.Syntax() == protoreflect.Proto2 && fd.Default().IsValid()
isSingularMessage := fd.Cardinality() != protoreflect.Repeated && fd.Kind() == protoreflect.MessageKind
if isProto2Scalar || isSingularMessage {
if fd.HasPresence() {
v = protoreflect.Value{} // use invalid value to emit null
}
if !f(fd, v) {
Expand Down

0 comments on commit dba644f

Please sign in to comment.