From d4e6a97812162f4b7c51dbb773869f3ca7fb1a42 Mon Sep 17 00:00:00 2001 From: Matt Robenolt Date: Wed, 10 Jul 2024 09:15:03 -0700 Subject: [PATCH] go/mysql: use clear builtin for zerofill (#16348) Signed-off-by: Matt Robenolt --- go/mysql/encoding.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/go/mysql/encoding.go b/go/mysql/encoding.go index b9d015e8948..20e09f32fe8 100644 --- a/go/mysql/encoding.go +++ b/go/mysql/encoding.go @@ -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 }