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

Method mapLen

decode_map.go:78–94  ·  view source on GitHub ↗
(c byte)

Source from the content-addressed store, hash-verified

76}
77
78func (d *Decoder) mapLen(c byte) (int, error) {
79 if c == msgpcode.Nil {
80 return -1, nil
81 }
82 if c >= msgpcode.FixedMapLow && c <= msgpcode.FixedMapHigh {
83 return int(c & msgpcode.FixedMapMask), nil
84 }
85 if c == msgpcode.Map16 {
86 size, err := d.uint16()
87 return int(size), err
88 }
89 if c == msgpcode.Map32 {
90 size, err := d.uint32()
91 return int(size), err
92 }
93 return 0, unexpectedCodeError{code: c, hint: "map length"}
94}
95
96func decodeMapStringStringValue(d *Decoder, v reflect.Value) error {
97 mptr := v.Addr().Convert(mapStringStringPtrType).Interface().(*map[string]string)

Callers 3

DecodeMapLenMethod · 0.95
skipMapMethod · 0.95
decodeStructValueFunction · 0.80

Calls 2

uint16Method · 0.95
uint32Method · 0.95

Tested by

no test coverage detected