diff options
| author | 2026-03-04 13:59:28 +0800 | |
|---|---|---|
| committer | 2026-03-04 14:07:45 +0800 | |
| commit | 95d8ceb9b612c776b3f6dce3c7a2236c17bd5313 (patch) | |
| tree | 584f99f27ea0d33cc358cdcb13246d7e156c3311 /refstore/reftable/parse_helpers.go | |
| parent | objectstore/packed: Split (diff) | |
| signature | No signature | |
refstore/reftable: Delete reftable support for now
Diffstat (limited to 'refstore/reftable/parse_helpers.go')
| -rw-r--r-- | refstore/reftable/parse_helpers.go | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/refstore/reftable/parse_helpers.go b/refstore/reftable/parse_helpers.go deleted file mode 100644 index 5b5fae24..00000000 --- a/refstore/reftable/parse_helpers.go +++ /dev/null @@ -1,41 +0,0 @@ -package reftable - -import "fmt" - -// readUint24 reads a 24-bit big-endian unsigned integer. -func readUint24(b []byte) uint32 { - return uint32(b[0])<<16 | uint32(b[1])<<8 | uint32(b[2]) -} - -// alignUp rounds pos up to the next multiple of blockSize. -func alignUp(pos, blockSize int) int { - rem := pos % blockSize - if rem == 0 { - return pos - } - - return pos + (blockSize - rem) -} - -// readVarint decodes one reftable/ofs-delta style varint. -func readVarint(buf []byte, off, end int) (uint64, int, error) { - if off >= end { - return 0, 0, fmt.Errorf("unexpected EOF") - } - - b := buf[off] - val := uint64(b & 0x7f) - - off++ - for b&0x80 != 0 { - if off >= end { - return 0, 0, fmt.Errorf("unexpected EOF") - } - - b = buf[off] - off++ - val = ((val + 1) << 7) | uint64(b&0x7f) - } - - return val, off, nil -} |
