Skip to content

Commit

Permalink
rhp4: use clear for zero reader (Chris)
Browse files Browse the repository at this point in the history
  • Loading branch information
n8maninger committed Sep 28, 2024
1 parent 9dc122d commit c1dddb9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions rhp/v4/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ var zeros = zeroReader{}
type zeroReader struct{}

func (r zeroReader) Read(p []byte) (int, error) {
for i := range p {
p[i] = 0
}
clear(p)
return len(p), nil
}

Expand Down

0 comments on commit c1dddb9

Please sign in to comment.