Skip to content

Commit

Permalink
go/mysql: use clear builtin for zerofill (#16348)
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Robenolt <[email protected]>
  • Loading branch information
mattrobenolt authored Jul 10, 2024
1 parent bc32d84 commit d4e6a97
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions go/mysql/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,8 @@ func writeLenEncString(data []byte, pos int, value string) int {
}

func writeZeroes(data []byte, pos int, len int) int {
// XXX: This implementation is optimized to leverage
// the go compiler's memclr pattern, see: https://github.com/golang/go/issues/5373
end := pos + len
data = data[pos:end]

for i := range data {
data[i] = 0
}

clear(data[pos:end])
return end
}

Expand Down

0 comments on commit d4e6a97

Please sign in to comment.