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

Function encodeBlockBetter

s2/encode_go.go:36–41  ·  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

34//
35// len(dst) >= MaxEncodedLen(len(src))
36func encodeBlockBetter(dst, src []byte) (d int) {
37 if len(src) <= 64<<10 {
38 return encodeBlockBetterGo64K(dst, src)
39 }
40 return encodeBlockBetterGo(dst, src)
41}
42
43// encodeBlockBetter encodes a non-empty src to a guaranteed-large-enough dst. It
44// assumes that the varint-encoded length of the decompressed bytes has already

Callers 2

EncodeBetterFunction · 0.70
encodeBlockMethod · 0.70

Calls 2

encodeBlockBetterGo64KFunction · 0.85
encodeBlockBetterGoFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…