cmd/go: break after terminal loop condition

After the first time needCostly is set to true, there is no need to
continue checking the remaining args.
This commit is contained in:
Mark Rushakoff 2020-10-07 22:05:28 -04:00
parent 5d1378143b
commit 6d0c19341b
1 changed files with 2 additions and 0 deletions

View File

@ -217,6 +217,7 @@ func runEnv(ctx context.Context, cmd *base.Command, args []string) {
needCostly = true
} else {
needCostly = false
checkCostly:
for _, arg := range args {
switch argKey(arg) {
case "CGO_CFLAGS",
@ -227,6 +228,7 @@ func runEnv(ctx context.Context, cmd *base.Command, args []string) {
"PKG_CONFIG",
"GOGCCFLAGS":
needCostly = true
break checkCostly
}
}
}