MCPcopy Create free account
hub / github.com/0xsequence/czip / end

Method end

compressor/buffer.go:122–140  ·  view source on GitHub ↗
(uncompressed []byte, t EncodeType)

Source from the content-addressed store, hash-verified

120}
121
122func (cb *Buffer) end(uncompressed []byte, t EncodeType) {
123 // We need 2 bytes to point to a flag, so any uncompressed value
124 // that is 2 bytes or less is not worth saving.
125 if len(uncompressed) > 2 {
126 rindex := cb.Len()
127
128 switch t {
129 case ReadStorage:
130 case Stateless:
131 cb.Refs.usedFlags[string(uncompressed)] = rindex + 1
132 case WriteStorage:
133 cb.Refs.usedStorageFlags[string(uncompressed)] = rindex + 1
134 default:
135 }
136 }
137
138 cb.Commited = append(cb.Commited, cb.Pending...)
139 cb.Pending = nil
140}
141
142type Snapshot struct {
143 Commited []byte

Calls 1

LenMethod · 0.95

Tested by

no test coverage detected