MCPcopy Index your code
hub / github.com/0xsequence/czip / FindPastData

Method FindPastData

compressor/buffer.go:112–120  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

110}
111
112func (cb *Buffer) FindPastData(data []byte) int {
113 for i := 0; i+len(data) < len(cb.Commited); i++ {
114 if bytes.Equal(cb.Commited[i:i+len(data)], data) {
115 return i
116 }
117 }
118
119 return -1
120}
121
122func (cb *Buffer) end(uncompressed []byte, t EncodeType) {
123 // We need 2 bytes to point to a flag, so any uncompressed value

Callers 2

EncodeWordOptimizedMethod · 0.95
WriteBytesOptimizedMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected