aboutsummaryrefslogtreecommitdiff
path: root/packfile/ingest/use.go
diff options
context:
space:
mode:
Diffstat (limited to 'packfile/ingest/use.go')
-rw-r--r--packfile/ingest/use.go34
1 files changed, 0 insertions, 34 deletions
diff --git a/packfile/ingest/use.go b/packfile/ingest/use.go
deleted file mode 100644
index 97f8757a..00000000
--- a/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
-}