MCPcopy
hub / github.com/klauspost/compress / encodeBlockBetterSnappy

Function encodeBlockBetterSnappy

s2/encode_go.go:50–55  ·  view source on GitHub ↗

encodeBlockBetter encodes a non-empty src to a guaranteed-large-enough dst. It assumes that the varint-encoded length of the decompressed bytes has already been written. It also assumes that: len(dst) >= MaxEncodedLen(len(src))

(dst, src []byte)

Source from the content-addressed store, hash-verified

48//
49// len(dst) >= MaxEncodedLen(len(src))
50func encodeBlockBetterSnappy(dst, src []byte) (d int) {
51 if len(src) <= 64<<10 {
52 return encodeBlockBetterSnappyGo64K(dst, src)
53 }
54 return encodeBlockBetterSnappyGo(dst, src)
55}
56
57// encodeBlock encodes a non-empty src to a guaranteed-large-enough dst. It
58// assumes that the varint-encoded length of the decompressed bytes has already

Callers 2

EncodeSnappyBetterFunction · 0.70
encodeBlockMethod · 0.70

Calls 2

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…