summaryrefslogtreecommitdiffstats
path: root/vendor/google.golang.org/protobuf/internal/impl/encode.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2021-06-16 21:00:49 +0200
committerGitHub <noreply@github.com>2021-06-16 21:00:49 +0200
commitfb5a84212c491332504fcdd4b5f4a4b97705d2e3 (patch)
treebe03e973d30d040a49a90c47f1e6b73ed8922539 /vendor/google.golang.org/protobuf/internal/impl/encode.go
parentdedc1c45a113d8db373d9e4638f54a0f9d29624f (diff)
downloadmatterbridge-msglm-fb5a84212c491332504fcdd4b5f4a4b97705d2e3.tar.gz
matterbridge-msglm-fb5a84212c491332504fcdd4b5f4a4b97705d2e3.tar.bz2
matterbridge-msglm-fb5a84212c491332504fcdd4b5f4a4b97705d2e3.zip
Update dependencies (#1521)
Diffstat (limited to 'vendor/google.golang.org/protobuf/internal/impl/encode.go')
-rw-r--r--vendor/google.golang.org/protobuf/internal/impl/encode.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/vendor/google.golang.org/protobuf/internal/impl/encode.go b/vendor/google.golang.org/protobuf/internal/impl/encode.go
index 8c8a794c..845c67d6 100644
--- a/vendor/google.golang.org/protobuf/internal/impl/encode.go
+++ b/vendor/google.golang.org/protobuf/internal/impl/encode.go
@@ -79,8 +79,9 @@ func (mi *MessageInfo) sizePointerSlow(p pointer, opts marshalOptions) (size int
size += f.funcs.size(fptr, f, opts)
}
if mi.unknownOffset.IsValid() {
- u := *p.Apply(mi.unknownOffset).Bytes()
- size += len(u)
+ if u := mi.getUnknownBytes(p); u != nil {
+ size += len(*u)
+ }
}
if mi.sizecacheOffset.IsValid() {
if size > math.MaxInt32 {
@@ -141,8 +142,9 @@ func (mi *MessageInfo) marshalAppendPointer(b []byte, p pointer, opts marshalOpt
}
}
if mi.unknownOffset.IsValid() && !mi.isMessageSet {
- u := *p.Apply(mi.unknownOffset).Bytes()
- b = append(b, u...)
+ if u := mi.getUnknownBytes(p); u != nil {
+ b = append(b, (*u)...)
+ }
}
return b, nil
}