archive/tar: use built-in clear to simplify code

This commit is contained in:
apocelipes 2024-03-07 17:40:11 +09:00
parent 58052fe8e7
commit 1743014078
1 changed files with 1 additions and 3 deletions

View File

@ -811,9 +811,7 @@ func (sr sparseFileReader) physicalRemaining() int64 {
type zeroReader struct{}
func (zeroReader) Read(b []byte) (int, error) {
for i := range b {
b[i] = 0
}
clear(b)
return len(b), nil
}