diff options
| author | Daniel Martí <mvdan@mvdan.cc> | 2019-03-05 20:44:29 +0000 |
|---|---|---|
| committer | Daniel Martí <mvdan@mvdan.cc> | 2019-03-08 14:29:19 +0000 |
| commit | 49662bc6b02810389c66b6b24576f6a5b217d471 (patch) | |
| tree | 15769762bf84bad2b9f1a4a1181845a5ad0673f5 /src/syscall/exec_linux_test.go | |
| parent | ce7534ff06df5b3148aa325deedcb94ac5b30ec0 (diff) | |
| download | go-49662bc6b02810389c66b6b24576f6a5b217d471.tar.xz | |
all: simplify multiple for loops
If a for loop has a simple condition and begins with a simple
"if x { break; }"; we can simply add "!x" to the loop's condition.
While at it, simplify a few assignments to use the common pattern
"x := staticDefault; if cond { x = otherValue(); }".
Finally, simplify a couple of var declarations.
Change-Id: I413982c6abd32905adc85a9a666cb3819139c19f
Reviewed-on: https://go-review.googlesource.com/c/go/+/165342
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/syscall/exec_linux_test.go')
0 files changed, 0 insertions, 0 deletions
