(uncompressed []byte, t EncodeType)
| 120 | } |
| 121 | |
| 122 | func (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 | |
| 142 | type Snapshot struct { |
| 143 | Commited []byte |
no test coverage detected