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

@@ -6,7 +6,6 @@ import (
"io"
"net"
"net/http"
"strings"
"sync"
"time"
@@ -113,7 +112,7 @@ func fetchUpdateCFIPRange(endpoint string, cfCIDRs *[]*types.CIDR) error {
return err
}
for _, line := range strings.Split(string(body), "\n") {
for _, line := range strutils.SplitLine(string(body)) {
if line == "" {
continue
}