perf: use strings.IndexByte to replace strings.Index (#7454)

Co-authored-by: 1911860538 <alxps1911@gmail.com>
This commit is contained in:
Name 2025-05-21 10:35:56 +08:00 committed by GitHub
parent 1c966e0d25
commit 9703eb775f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -105,7 +105,7 @@ func parseFieldIndexes(field *Field) (indexes []Index, err error) {
var (
name string
tag = strings.Join(v[1:], ":")
idx = strings.Index(tag, ",")
idx = strings.IndexByte(tag, ',')
tagSetting = strings.Join(strings.Split(tag, ",")[1:], ",")
settings = ParseTagSetting(tagSetting, ",")
length, _ = strconv.Atoi(settings["LENGTH"])

View File

@ -675,7 +675,7 @@ func (rel *Relationship) ParseConstraint() *Constraint {
var (
name string
idx = strings.Index(str, ",")
idx = strings.IndexByte(str, ',')
settings = ParseTagSetting(str, ",")
)