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

@@ -4,7 +4,6 @@ import (
"context"
"errors"
"fmt"
"strings"
"time"
"github.com/yusing/go-proxy/internal/common"
@@ -141,7 +140,7 @@ func (mon *monitor) Uptime() time.Duration {
// Name implements HealthMonitor.
func (mon *monitor) Name() string {
parts := strings.Split(mon.service, "/")
parts := strutils.SplitRune(mon.service, '/')
return parts[len(parts)-1]
}