small string split join optimization

This commit is contained in:
yusing
2024-12-19 00:54:31 +08:00
parent 654194b274
commit e7be27413c
20 changed files with 160 additions and 50 deletions

View File

@@ -1,9 +1,8 @@
package docker
import (
"strings"
E "github.com/yusing/go-proxy/internal/error"
"github.com/yusing/go-proxy/internal/utils/strutils"
)
type LabelMap = map[string]any
@@ -13,7 +12,7 @@ func ParseLabels(labels map[string]string) (LabelMap, E.Error) {
errs := E.NewBuilder("labels error")
for lbl, value := range labels {
parts := strings.Split(lbl, ".")
parts := strutils.SplitRune(lbl, '.')
if parts[0] != NSProxy {
continue
}