Skip to content

Commit 3136567

Browse files
committed
Replace loop with unpacking
1 parent 030cc65 commit 3136567

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

shellwords.go

+2-6
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,7 @@ loop:
163163
if err != nil {
164164
return nil, err
165165
}
166-
for _, str := range strs {
167-
args = append(args, str)
168-
}
166+
args = append(args, strs...)
169167
} else {
170168
args = append(args, replaceEnv(p.Getenv, buf))
171169
}
@@ -267,9 +265,7 @@ loop:
267265
if err != nil {
268266
return nil, err
269267
}
270-
for _, str := range strs {
271-
args = append(args, str)
272-
}
268+
args = append(args, strs...)
273269
} else {
274270
args = append(args, replaceEnv(p.Getenv, buf))
275271
}

0 commit comments

Comments
 (0)