aboutsummaryrefslogtreecommitdiff
path: root/format/packfile/ingest/use.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-30 14:28:13 +0000
committerGravatar Runxi Yu2026-03-30 14:28:13 +0000
commita4eeb727468a178a4de0dfc718828f26740484ac (patch)
tree4318d38d49facc80e2e2186f5919fa656be3b31f /format/packfile/ingest/use.go
parentobject/store/packed: Make store own root, algo, opts (diff)
signatureNo signature
object,store/packed{,/internal/ingest}: Move from format/packfile/ingest
Diffstat (limited to 'format/packfile/ingest/use.go')
-rw-r--r--format/packfile/ingest/use.go34
1 files changed, 0 insertions, 34 deletions
diff --git a/format/packfile/ingest/use.go b/format/packfile/ingest/use.go
deleted file mode 100644
index 97f8757a..00000000
--- a/format/packfile/ingest/use.go
+++ /dev/null
@@ -1,34 +0,0 @@
-package ingest
-
-import (
- "fmt"
- "hash/crc32"
-)
-
-// use consumes n unread bytes and updates accounting/checksum state.
-func (scanner *streamScanner) use(n int) error {
- if n < 0 || n > scanner.n-scanner.off {
- return fmt.Errorf("packfile/ingest: invalid consume length %d", n)
- }
-
- if n == 0 {
- return nil
- }
-
- chunk := scanner.buf[scanner.off : scanner.off+n]
- if scanner.hashEnabled {
- _, err := scanner.hash.Write(chunk)
- if err != nil {
- return err
- }
- }
-
- if scanner.inEntryCRC {
- scanner.entryCRC = crc32.Update(scanner.entryCRC, crc32.IEEETable, chunk)
- }
-
- scanner.off += n
- scanner.consumed += uint64(n)
-
- return nil
-}