mirror of
https://github.com/golang/go
synced 2024-11-22 08:54:39 -07:00
archive/tar: use built-in clear to simplify code
This commit is contained in:
parent
58052fe8e7
commit
1743014078
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user