Skip to content

Commit 8e3fc5e

Browse files
committed
String performance optimization
1 parent bc73854 commit 8e3fc5e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Diff for: version.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"database/sql"
55
"database/sql/driver"
66
"encoding/json"
7-
"fmt"
87
"reflect"
98
"strconv"
109
"sync"
@@ -136,6 +135,6 @@ func (v VersionUpdateClause) ModifyStatement(stmt *gorm.Statement) {
136135
stmt.Dest = d
137136
}
138137

139-
stmt.SetColumn(v.Field.DBName, clause.Expr{SQL: fmt.Sprintf("%s+1", stmt.Quote(v.Field.DBName))}, true)
138+
stmt.SetColumn(v.Field.DBName, clause.Expr{SQL: stmt.Quote(v.Field.DBName) + "+1"}, true)
140139
stmt.Clauses["version_enabled"] = clause.Clause{}
141140
}

0 commit comments

Comments
 (0)