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

Function msgpackWriteUint

internal/api/encoder/encoder.go:768–779  ·  view source on GitHub ↗
(buf []byte, value uint32)

Source from the content-addressed store, hash-verified

766}
767
768func msgpackWriteUint(buf []byte, value uint32) []byte {
769 if value <= 0x7f {
770 return append(buf, byte(value))
771 }
772 if value <= 0xff {
773 return append(buf, 0xcc, byte(value))
774 }
775 if value <= 0xffff {
776 return append(buf, 0xcd, byte(value>>8), byte(value))
777 }
778 return append(buf, 0xce, byte(value>>24), byte(value>>16), byte(value>>8), byte(value))
779}
780
781func msgpackWriteString(buf []byte, s string) []byte {
782 n := len(s)

Callers 3

encodeFileReferencesFunction · 0.85
encodeNodeIndexArrayFunction · 0.85

Calls 1

appendFunction · 0.50

Tested by

no test coverage detected