MCPcopy Create free account
hub / github.com/brimdata/super / DecodeCountedVarint

Function DecodeCountedVarint

scode/counted.go:47–57  ·  view source on GitHub ↗
(b []byte)

Source from the content-addressed store, hash-verified

45}
46
47func DecodeCountedVarint(b []byte) int64 {
48 u64 := DecodeCountedUvarint(b)
49 if u64&1 != 0 {
50 u64 >>= 1
51 if u64 == 0 {
52 return math.MinInt64
53 }
54 return -int64(u64)
55 }
56 return int64(u64 >> 1)
57}
58
59func EncodeCountedVarint(dst []byte, i int64) uint {
60 var u64 uint64

Callers 2

DecodeIntFunction · 0.92
DecodeTimeFunction · 0.92

Calls 1

DecodeCountedUvarintFunction · 0.85

Tested by

no test coverage detected