1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00

refactor: use strings.FieldsFuncSeq to reduce memory allocations

Signed-off-by: juejinyuxitu <juejinyuxitu@outlook.com>
This commit is contained in:
juejinyuxitu
2025-09-24 23:03:33 +08:00
committed by Nick Craig-Wood
parent d44957a09c
commit 7e30665102

View File

@@ -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, ",")