MCPcopy Create free account
hub / github.com/segmentio/encoding / byteArraySizeFuncOf

Function byteArraySizeFuncOf

proto/bytes.go:146–154  ·  view source on GitHub ↗
(n int)

Source from the content-addressed store, hash-verified

144}
145
146func byteArraySizeFuncOf(n int) sizeFunc {
147 size := sizeOfVarlen(n)
148 return func(p unsafe.Pointer, flags flags) int {
149 if p != nil && (flags.has(wantzero) || !isZeroBytes(makeBytes(p, n))) {
150 return size
151 }
152 return 0
153 }
154}
155
156func byteArrayEncodeFuncOf(n int) encodeFunc {
157 return func(b []byte, p unsafe.Pointer, flags flags) (int, error) {

Callers 1

byteArrayCodecOfFunction · 0.85

Calls 4

sizeOfVarlenFunction · 0.85
isZeroBytesFunction · 0.85
makeBytesFunction · 0.85
hasMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…