cmd/5g etc: merge simple case expressions onto fewer lines
The c2go translation left a lot of case expressions on separate lines.
Merge expressions onto single lines subject to these constraints:
* Max 4 clauses, all literals or names
* Don't move expressions with comments
The change was created by running http://play.golang.org/p/yHajs72h-g:
$ mergecase cmd/internal/{ld,gc,obj}/*.go cmd/internal/obj/*/*.go
Passes toolstash -cmp.
Change-Id: Iba41b390d302e5486e5dc6ba7599a92270676556
Reviewed-on: https://go-review.googlesource.com/7593
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
diff --git a/src/cmd/internal/gc/cgen.go b/src/cmd/internal/gc/cgen.go
index 7566dda..f92a98f 100644
--- a/src/cmd/internal/gc/cgen.go
+++ b/src/cmd/internal/gc/cgen.go
@@ -172,8 +172,7 @@
// can't do in walk because n->left->addable
// changes if n->left is an escaping local variable.
switch n.Op {
- case OSPTR,
- OLEN:
+ case OSPTR, OLEN:
if Isslice(n.Left.Type) || Istype(n.Left.Type, TSTRING) {
n.Addable = n.Left.Addable
}
@@ -665,9 +664,7 @@
}
}
- case OLSH,
- ORSH,
- OLROT:
+ case OLSH, ORSH, OLROT:
Thearch.Cgen_shift(int(n.Op), n.Bounded, nl, nr, res)
}
@@ -1569,9 +1566,7 @@
Fixlargeoffset(a)
return
- case OCALLFUNC,
- OCALLMETH,
- OCALLINTER:
+ case OCALLFUNC, OCALLMETH, OCALLINTER:
switch n.Op {
case OCALLFUNC:
cgen_call(n, 0)