Chore: Avoid unnecessary byte/string conversions (#69001)
Avoid unnecessary byte/string conversion We can use alternative functions/methods to avoid unnecessary byte/string conversion calls. Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
@@ -1019,7 +1019,7 @@ func (m *SQLMacroEngineBase) ReplaceAllStringSubmatchFunc(re *regexp.Regexp, str
|
||||
result := ""
|
||||
lastIndex := 0
|
||||
|
||||
for _, v := range re.FindAllSubmatchIndex([]byte(str), -1) {
|
||||
for _, v := range re.FindAllStringSubmatchIndex(str, -1) {
|
||||
groups := []string{}
|
||||
for i := 0; i < len(v); i += 2 {
|
||||
groups = append(groups, str[v[i]:v[i+1]])
|
||||
|
||||
Reference in New Issue
Block a user