MCPcopy
hub / github.com/tinylib/msgp / WriteMapHeader

Method WriteMapHeader

msgp/write.go:324–333  ·  view source on GitHub ↗

WriteMapHeader writes a map header of the given size to the writer

(sz uint32)

Source from the content-addressed store, hash-verified

322// WriteMapHeader writes a map header of the given
323// size to the writer
324func (mw *Writer) WriteMapHeader(sz uint32) error {
325 switch {
326 case sz <= 15:
327 return mw.push(wfixmap(uint8(sz)))
328 case sz <= math.MaxUint16:
329 return mw.prefix16(mmap16, uint16(sz))
330 default:
331 return mw.prefix32(mmap32, sz)
332 }
333}
334
335// WriteArrayHeader writes an array header of the
336// given size to the writer

Callers 15

TestReadMapHeaderBytesFunction · 0.95
BenchmarkSkipBytesFunction · 0.95
TestReadIntfRecursionFunction · 0.95
TestSkipRecursionFunction · 0.95
TestReadMapHeaderFunction · 0.95
TestSkipFunction · 0.95
BenchmarkSkipFunction · 0.95
TestCopyNextFunction · 0.95
TestRemoveFunction · 0.95
TestLocateFunction · 0.95
TestReplaceFunction · 0.95
BenchmarkLocateFunction · 0.95

Calls 4

pushMethod · 0.95
prefix16Method · 0.95
prefix32Method · 0.95
wfixmapFunction · 0.85

Tested by 15

TestReadMapHeaderBytesFunction · 0.76
BenchmarkSkipBytesFunction · 0.76
TestReadIntfRecursionFunction · 0.76
TestSkipRecursionFunction · 0.76
TestReadMapHeaderFunction · 0.76
TestSkipFunction · 0.76
BenchmarkSkipFunction · 0.76
TestCopyNextFunction · 0.76
TestRemoveFunction · 0.76
TestLocateFunction · 0.76
TestReplaceFunction · 0.76
BenchmarkLocateFunction · 0.76