MCPcopy Index your code
hub / github.com/microsoft/typescript-go / msgpackWriteArrayHeader

Function msgpackWriteArrayHeader

internal/api/encoder/encoder.go:758–766  ·  view source on GitHub ↗

Minimal msgpack writers for the structured data section.

(buf []byte, length int)

Source from the content-addressed store, hash-verified

756// Minimal msgpack writers for the structured data section.
757
758func msgpackWriteArrayHeader(buf []byte, length int) []byte {
759 if length <= 0x0f {
760 return append(buf, byte(0x90|length))
761 }
762 if length <= 0xffff {
763 return append(buf, 0xdc, byte(length>>8), byte(length))
764 }
765 return append(buf, 0xdd, byte(length>>24), byte(length>>16), byte(length>>8), byte(length))
766}
767
768func msgpackWriteUint(buf []byte, value uint32) []byte {
769 if value <= 0x7f {

Callers 4

encodeFileReferencesFunction · 0.85
encodeNodeIndexArrayFunction · 0.85
encodeStringArrayFunction · 0.85

Calls 1

appendFunction · 0.50

Tested by

no test coverage detected