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

Method DecodeMapLen

decode_map.go:59–76  ·  view source on GitHub ↗

DecodeMapLen decodes map length. Length is -1 when map is nil.

()

Source from the content-addressed store, hash-verified

57
58// DecodeMapLen decodes map length. Length is -1 when map is nil.
59func (d *Decoder) DecodeMapLen() (int, error) {
60 c, err := d.readCode()
61 if err != nil {
62 return 0, err
63 }
64
65 if msgpcode.IsExt(c) {
66 if err = d.skipExtHeader(c); err != nil {
67 return 0, err
68 }
69
70 c, err = d.readCode()
71 if err != nil {
72 return 0, err
73 }
74 }
75 return d.mapLen(c)
76}
77
78func (d *Decoder) mapLen(c byte) (int, error) {
79 if c == msgpcode.Nil {

Callers 7

DecodeMapMethod · 0.95
DecodeUntypedMapMethod · 0.95
DecodeTypedMapMethod · 0.95
queryMapKeyMethod · 0.95
decodeMapValueFunction · 0.80

Calls 4

readCodeMethod · 0.95
skipExtHeaderMethod · 0.95
mapLenMethod · 0.95
IsExtFunction · 0.92

Tested by 1