Skip to content

Commit 1743014

Browse files
committed
archive/tar: use built-in clear to simplify code
1 parent 58052fe commit 1743014

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/archive/tar/reader.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -811,9 +811,7 @@ func (sr sparseFileReader) physicalRemaining() int64 {
811811
type zeroReader struct{}
812812

813813
func (zeroReader) Read(b []byte) (int, error) {
814-
for i := range b {
815-
b[i] = 0
816-
}
814+
clear(b)
817815
return len(b), nil
818816
}
819817

0 commit comments

Comments
 (0)