aboutsummaryrefslogtreecommitdiff
path: root/internal/flatex/decompress.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-02-20 19:06:13 +0800
committerGravatar Runxi Yu2026-02-20 19:07:14 +0800
commitaa513c069c1418734aea894dc944e27c6a78a3bb (patch)
tree687f0a11bb550fa088fd82a98ceb8979bbc35f69 /internal/flatex/decompress.go
parentComment on prior reverts removing the pack writing API (diff)
signatureNo signature
Delete everything, I'm redesigning this.
I'll stop using a flat package and make things much more modular. And also experiment with streaming APIs so large blobs don't OOM us.
Diffstat (limited to 'internal/flatex/decompress.go')
-rw-r--r--internal/flatex/decompress.go38
1 files changed, 0 insertions, 38 deletions
diff --git a/internal/flatex/decompress.go b/internal/flatex/decompress.go
deleted file mode 100644
index 065e23f3..00000000
--- a/internal/flatex/decompress.go
+++ /dev/null
@@ -1,38 +0,0 @@
-package flatex
-
-import (
- "io"
-
- "codeberg.org/lindenii/furgit/internal/bufpool"
-)
-
-func DecompressSized(src []byte, sizeHint int) (bufpool.Buffer, int, error) {
- d := sliceInflaterPool.Get().(*sliceInflater)
- defer sliceInflaterPool.Put(d)
-
- if err := d.reset(src); err != nil {
- return bufpool.Buffer{}, 0, err
- }
-
- out := bufpool.Borrow(sizeHint)
- out.Resize(0)
-
- for {
- if len(d.toRead) > 0 {
- out.Append(d.toRead)
- d.toRead = nil
- continue
- }
- if d.err != nil {
- if d.err == io.EOF {
- return out, d.pos, nil
- }
- out.Release()
- return bufpool.Buffer{}, 0, d.err
- }
- d.step(d)
- if d.err != nil && len(d.toRead) == 0 {
- d.toRead = d.window.readFlush()
- }
- }
-}