MCPcopy Index your code
hub / github.com/vmihailenco/msgpack / arrayLen

Method arrayLen

decode_slice.go:21–36  ·  view source on GitHub ↗
(c byte)

Source from the content-addressed store, hash-verified

19}
20
21func (d *Decoder) arrayLen(c byte) (int, error) {
22 if c == msgpcode.Nil {
23 return -1, nil
24 } else if c >= msgpcode.FixedArrayLow && c <= msgpcode.FixedArrayHigh {
25 return int(c & msgpcode.FixedArrayMask), nil
26 }
27 switch c {
28 case msgpcode.Array16:
29 n, err := d.uint16()
30 return int(n), err
31 case msgpcode.Array32:
32 n, err := d.uint32()
33 return int(n), err
34 }
35 return 0, fmt.Errorf("msgpack: invalid code=%x decoding array length", c)
36}
37
38func decodeStringSliceValue(d *Decoder, v reflect.Value) error {
39 ptr := v.Addr().Convert(sliceStringPtrType).Interface().(*[]string)

Callers 4

DecodeArrayLenMethod · 0.95
decodeSliceMethod · 0.95
skipSliceMethod · 0.95
decodeStructValueFunction · 0.80

Calls 2

uint16Method · 0.95
uint32Method · 0.95

Tested by

no test coverage detected