From 65287f0e0f3f8e5aaa1e95ded15a80235ecb8c04 Mon Sep 17 00:00:00 2001 From: beck <34204218+beck-8@users.noreply.github.com> Date: Sat, 29 Aug 2026 21:05:32 +0800 Subject: [PATCH] chore: reduce memory usage in converter (#3159) --- common/convert/converter.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/convert/converter.go b/common/convert/converter.go index a4faf9b2..2db43ca6 100644 --- a/common/convert/converter.go +++ b/common/convert/converter.go @@ -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 }