Skip to content

Commit fafa092

Browse files
committed
Use builtin clear() to clear buffer.
1 parent 8a9bfd1 commit fafa092

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎ot/iknp.go‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,7 @@ func newPrg(key Label) (cipher.Stream, error) {
438438
func prg(c cipher.Stream, buf []byte) {
439439
// Clear buffer as it is shared between different caller's
440440
// iterations.
441-
for i := 0; i < len(buf); i++ {
442-
buf[i] = 0
443-
}
441+
clear(buf)
444442
c.XORKeyStream(buf, buf)
445443
}
446444

0 commit comments

Comments
 (0)