aboutsummaryrefslogtreecommitdiff
path: root/format/pack
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-06 13:11:56 +0800
committerGravatar Runxi Yu2026-03-06 13:12:06 +0800
commit195447b77ff5fc37e184d2d0e7aae99aec250d8c (patch)
treec683dc459d333e8b8c71689b9d2cd3d9e8649650 /format/pack
parentformat/pack/ingest: I don't think we need to use a clone there (diff)
signatureNo signature
*: go fix ./...
Diffstat (limited to 'format/pack')
-rw-r--r--format/pack/ingest/stream.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/format/pack/ingest/stream.go b/format/pack/ingest/stream.go
index 66a6fc5f..a403087a 100644
--- a/format/pack/ingest/stream.go
+++ b/format/pack/ingest/stream.go
@@ -69,10 +69,7 @@ func (scanner *streamScanner) Read(dst []byte) (int, error) {
return 0, io.EOF
}
- n := len(dst)
- if n > unread {
- n = unread
- }
+ n := min(len(dst), unread)
copy(dst, scanner.buf[scanner.off:scanner.off+n])