From 7e30665102cbef8776c8bc1dadba0e3772d1fe7e Mon Sep 17 00:00:00 2001 From: juejinyuxitu Date: Wed, 24 Sep 2025 23:03:33 +0800 Subject: [PATCH] refactor: use strings.FieldsFuncSeq to reduce memory allocations Signed-off-by: juejinyuxitu --- fs/bwtimetable.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/bwtimetable.go b/fs/bwtimetable.go index 9a2173862..f17e3ee30 100644 --- a/fs/bwtimetable.go +++ b/fs/bwtimetable.go @@ -151,7 +151,7 @@ func (x *BwTimetable) Set(s string) error { } // Split the timetable string by both spaces and semicolons - for _, tok := range strings.FieldsFunc(s, func(r rune) bool { + for tok := range strings.FieldsFuncSeq(s, func(r rune) bool { return r == ' ' || r == ';' }) { tv := strings.Split(tok, ",")