1
0
mirror of https://github.com/golang/go synced 2024-11-26 01:07:57 -07:00

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

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
}