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:
committed by
Nick Craig-Wood
parent
d44957a09c
commit
7e30665102
@@ -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, ",")
|
||||
|
||||
Reference in New Issue
Block a user