mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
3de87bc4d9
commit
1da62afeef
13 changed files with 23 additions and 23 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue