cmd/compile: replace len(Nodes.Slice()) with Nodes.Len()

Generated with eg:

func before(n gc.Nodes) int { return len(n.Slice()) }
func after(n gc.Nodes) int  { return n.Len() }

Change-Id: Ifdf01915e60069166afe96aa7b1d08720bf62fc5
Reviewed-on: https://go-review.googlesource.com/22420
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Josh Bleecher Snyder 2016-04-24 13:50:26 -07:00
parent 3de87bc4d9
commit 1da62afeef
13 changed files with 23 additions and 23 deletions

View file

@ -194,7 +194,7 @@ func makeclosure(func_ *Node) *Node {
xfunc.Nbody.Set(func_.Nbody.Slice())
xfunc.Func.Dcl = append(func_.Func.Dcl, xfunc.Func.Dcl...)
func_.Func.Dcl = nil
if len(xfunc.Nbody.Slice()) == 0 {
if xfunc.Nbody.Len() == 0 {
Fatalf("empty body - won't generate any code")
}
xfunc = typecheck(xfunc, Etop)