From 9d8a5bb208f5616638cbaad878a12d5ac73970d3 Mon Sep 17 00:00:00 2001 From: "hjwblog.com" Date: Tue, 10 Oct 2023 14:45:48 +0800 Subject: [PATCH] feat: reuse name (#6626) --- clause/expression.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clause/expression.go b/clause/expression.go index 8d010522..3140846e 100644 --- a/clause/expression.go +++ b/clause/expression.go @@ -126,7 +126,7 @@ func (expr NamedExpr) Build(builder Builder) { for _, v := range []byte(expr.SQL) { if v == '@' && !inName { inName = true - name = []byte{} + name = name[:0] } else if v == ' ' || v == ',' || v == ')' || v == '"' || v == '\'' || v == '`' || v == '\r' || v == '\n' || v == ';' { if inName { if nv, ok := namedMap[string(name)]; ok {