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

Function encodeInt

proto/int.go:23–30  ·  view source on GitHub ↗
(b []byte, p unsafe.Pointer, flags flags)

Source from the content-addressed store, hash-verified

21}
22
23func encodeInt(b []byte, p unsafe.Pointer, flags flags) (int, error) {
24 if p != nil {
25 if v := *(*int)(p); v != 0 || flags.has(wantzero) {
26 return encodeVarint(b, flags.uint64(int64(v)))
27 }
28 }
29 return 0, nil
30}
31
32func decodeInt(b []byte, p unsafe.Pointer, flags flags) (int, error) {
33 v, n, err := decodeVarint(b)

Callers

nothing calls this directly

Calls 3

encodeVarintFunction · 0.85
uint64Method · 0.80
hasMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…