MCPcopy
hub / github.com/vmihailenco/msgpack / EncodeMapLen

Method EncodeMapLen

encode_map.go:182–190  ·  view source on GitHub ↗
(l int)

Source from the content-addressed store, hash-verified

180}
181
182func (e *Encoder) EncodeMapLen(l int) error {
183 if l < 16 {
184 return e.writeCode(msgpcode.FixedMapLow | byte(l))
185 }
186 if l <= math.MaxUint16 {
187 return e.write2(msgpcode.Map16, uint16(l))
188 }
189 return e.write4(msgpcode.Map32, uint32(l))
190}
191
192func encodeStructValue(e *Encoder, strct reflect.Value) error {
193 structFields := structs.Fields(strct.Type(), e.structTag)

Callers 6

EncodeMapMethod · 0.95
EncodeMapSortedMethod · 0.95
encodeMapValueFunction · 0.80
encodeMapStringBoolValueFunction · 0.80
encodeStructValueFunction · 0.80

Calls 3

writeCodeMethod · 0.95
write2Method · 0.95
write4Method · 0.95

Tested by

no test coverage detected