cmd/compile: change export.go and fmt.go to use nodeSeq

Also fix some uses of nodeSeqIterator.Len, and fix the implementation in
nodesIterator.

Passes toolstash -cmp.

Update #14473.

Change-Id: I228871470234b7f1314ffd2aae8a4c0624c35f98
Reviewed-on: https://go-review.googlesource.com/20231
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
diff --git a/src/cmd/compile/internal/gc/walk.go b/src/cmd/compile/internal/gc/walk.go
index 94b20b1..9b5449b 100644
--- a/src/cmd/compile/internal/gc/walk.go
+++ b/src/cmd/compile/internal/gc/walk.go
@@ -22,7 +22,7 @@
 
 	if Debug['W'] != 0 {
 		s := fmt.Sprintf("\nbefore %v", Curfn.Func.Nname.Sym)
-		dumpslice(s, Curfn.Nbody.Slice())
+		dumplist(s, Curfn.Nbody)
 	}
 
 	lno := lineno
@@ -67,13 +67,13 @@
 	walkstmtlist(Curfn.Nbody)
 	if Debug['W'] != 0 {
 		s := fmt.Sprintf("after walk %v", Curfn.Func.Nname.Sym)
-		dumpslice(s, Curfn.Nbody.Slice())
+		dumplist(s, Curfn.Nbody)
 	}
 
 	heapmoves()
 	if Debug['W'] != 0 && len(Curfn.Func.Enter.Slice()) > 0 {
 		s := fmt.Sprintf("enter %v", Curfn.Func.Nname.Sym)
-		dumpslice(s, Curfn.Func.Enter.Slice())
+		dumplist(s, Curfn.Func.Enter)
 	}
 }
 
@@ -2963,7 +2963,7 @@
 		nx = Nod(OINDEX, ns, nn) // s[n] ...
 		nx.Bounded = true
 		l = append(l, Nod(OAS, nx, it.N())) // s[n] = arg
-		if it.Len() != 0 {
+		if it.Len() > 1 {
 			l = append(l, Nod(OAS, nn, Nod(OADD, nn, Nodintconst(1)))) // n = n + 1
 		}
 	}