From 3a172c08597612336228c614913555e26a14529a Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Sat, 21 Dec 2024 23:19:50 -0500 Subject: [PATCH] Simplify buffer allocation Signed-off-by: Matt Lord --- go/mysql/binlog/binlog_json.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/mysql/binlog/binlog_json.go b/go/mysql/binlog/binlog_json.go index 99845515823..e6b7d09819d 100644 --- a/go/mysql/binlog/binlog_json.go +++ b/go/mysql/binlog/binlog_json.go @@ -83,7 +83,7 @@ func ParseBinaryJSONDiff(data []byte) (sqltypes.Value, error) { // Reasonable estimate of the space we'll need to build the SQL // expression in order to try and avoid reallocations w/o // overallocating too much. - diff.Grow(int(float32(len(data)) * 1.25)) + diff.Grow(len(data) + 80) pos := 0 outer := false innerStr := ""