Skip to content

Commit f535bac

Browse files
committed
refactor: replace Split in loops with more efficient SplitSeq
Signed-off-by: box4wangjing <box4wangjing@outlook.com>
1 parent 731d818 commit f535bac

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

middleware/extractor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ func createExtractors(lookups string, limit uint) ([]ValuesExtractor, error) {
8585
limit = extractorLimit
8686
}
8787

88-
sources := strings.Split(lookups, ",")
88+
sources := strings.SplitSeq(lookups, ",")
8989
var extractors = make([]ValuesExtractor, 0)
90-
for _, source := range sources {
90+
for source := range sources {
9191
parts := strings.Split(source, ":")
9292
if len(parts) < 2 {
9393
return nil, fmt.Errorf("extractor source for lookup could not be split into needed parts: %v", source)

0 commit comments

Comments
 (0)