]> Cypherpunks repositories - gostls13.git/commit
cmd: remove some unnecessary gotos
authorDaniel Martí <mvdan@mvdan.cc>
Sun, 29 Apr 2018 13:17:23 +0000 (22:17 +0900)
committerDaniel Martí <mvdan@mvdan.cc>
Tue, 1 May 2018 10:46:08 +0000 (10:46 +0000)
commit9ecf899b295c3661bb6ad0e7345fb479986d13f0
tree253ce0f3743b821af9adf47773fc8239f4aa7304
parent030ac2c719e14925830de5e97d4ef86b3ab5826f
cmd: remove some unnecessary gotos

Pick the low-hanging fruit, which are the gotos that don't go very far
and labels that aren't used often. All of them have easy replacements
with breaks and returns.

One slightly tricky rewrite is defaultlitreuse. We cannot use a defer
func to reset lineno, because one of its return paths does not reset
lineno, and thus broke toolstash -cmp.

Passes toolstash -cmp on std cmd.

Change-Id: Id1c0967868d69bb073addc7c5c3017ca91ff966f
Reviewed-on: https://go-review.googlesource.com/110063
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/const.go
src/cmd/compile/internal/gc/walk.go
src/cmd/internal/obj/arm64/asm7.go
src/cmd/internal/obj/mips/asm0.go
src/cmd/internal/obj/mips/obj0.go
src/cmd/internal/obj/ppc64/asm9.go
src/cmd/internal/obj/s390x/asmz.go