Skip to content

Commit 37a3a5e

Browse files
Merge pull request cri-o#9078 from saschagrunert/split-seq
Use `strings.SplitSeq` instead of `strings.Split`
2 parents e137827 + 2fa08cf commit 37a3a5e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

server/masked_paths.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ var possibleCPUsParsed = sync.OnceValue(func() (cpus []int) {
5959
return nil
6060
}
6161

62-
ranges := strings.Split(strings.TrimSpace(string(data)), ",")
63-
64-
for _, r := range ranges {
62+
for r := range strings.SplitSeq(strings.TrimSpace(string(data)), ",") {
6563
if rStart, rEnd, ok := strings.Cut(r, "-"); !ok {
6664
cpu, err := strconv.Atoi(rStart)
6765
if err != nil {

0 commit comments

Comments
 (0)