Skip to content

Commit b57a544

Browse files
apocelipesgopherbot
authored andcommitted
archive/tar: use built-in clear to simplify code
Change-Id: I0e55dd68d92c39aba511b55368bf50d929d75f86 GitHub-Last-Rev: 1743014 GitHub-Pull-Request: #66158 Reviewed-on: https://go-review.googlesource.com/c/go/+/569696 Reviewed-by: Michael Knyszek <[email protected]> Reviewed-by: qiulaidongfeng <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 80a91d3 commit b57a544

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)