1
0
mirror of https://github.com/MetaCubeX/mihomo.git synced 2026-10-10 04:03:11 +08:00

chore: reduce memory usage in converter (#3159)

This commit is contained in:
beck
2026-08-29 21:05:32 +08:00
committed by GitHub
parent 061966e797
commit 65287f0e0f
+4 -4
View File
@@ -16,13 +16,13 @@ import (
func ConvertsV2Ray(buf []byte) ([]map[string]any, error) {
data := DecodeBase64(buf)
arr := strings.Split(string(data), "\n")
rawLines := bytes.Split(data, []byte("\n"))
proxies := make([]map[string]any, 0, len(arr))
proxies := make([]map[string]any, 0, len(rawLines))
names := make(map[string]int, 200)
for _, line := range arr {
line = strings.TrimRight(line, " \r")
for _, raw := range rawLines {
line := strings.TrimRight(string(raw), " \r")
if line == "" {
continue
}