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

Method ResetPrefix

zstd/enc_dfast.go:1040–1050  ·  view source on GitHub ↗
(prefix []byte)

Source from the content-addressed store, hash-verified

1038}
1039
1040func (e *doubleFastEncoder) ResetPrefix(prefix []byte) {
1041 e.fastEncoder.ResetPrefix(prefix)
1042 if len(prefix) < 8 {
1043 return
1044 }
1045 end := e.cur + int32(len(prefix)) - 8
1046 for i := e.cur + 1; i < end; i += 2 {
1047 cv := load6432(prefix, i-e.cur)
1048 e.longTable[hashLen(cv, dFastLongTableBits, dFastLongLen)] = tableEntry{val: uint32(cv), offset: i}
1049 }
1050}
1051
1052// ResetDict will reset and set a dictionary if not nil
1053func (e *doubleFastEncoderDict) Reset(d *dict, singleBlock bool) {

Callers

nothing calls this directly

Calls 3

load6432Function · 0.70
hashLenFunction · 0.70
ResetPrefixMethod · 0.65

Tested by

no test coverage detected