cmd/compile/internal/gc: cleaning; use range when appropriate

Made use of range statement in for loops.
Cleaning along the way:
-remove unnecessary variable declarations
-rename variables
-remove dead code

This change passes go build -toolexec 'toolstash -cmp' -a std.

Change-Id: Ife8c2a98482a81ba91f5bbb65142d9f3dc46d6ee
Reviewed-on: https://go-review.googlesource.com/14379
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
This commit is contained in:
Marvin Stenger 2015-09-08 22:22:44 +02:00 committed by Dave Cheney
parent a326c3e1ad
commit 2dc63d1544
6 changed files with 172 additions and 247 deletions

View file

@ -3358,7 +3358,6 @@ func ngotype(n *Node) *Sym {
* only in the last segment of the path, and it makes for happier
* users if we escape that as little as possible.
*
* If you edit this, edit ../ld/lib.c:/^pathtoprefix too.
* If you edit this, edit ../../debug/goobj/read.go:/importPathToPrefix too.
*/
func pathtoprefix(s string) string {
@ -3430,17 +3429,13 @@ func isbadimport(path string) bool {
return true
}
for i := 0; i < len(reservedimports); i++ {
if path == reservedimports[i] {
for _, ri := range reservedimports {
if path == ri {
Yyerror("import path %q is reserved and cannot be used", path)
return true
}
}
var s string
_ = s
var r uint
_ = r
for _, r := range path {
if r == utf8.RuneError {
Yyerror("import path contains invalid UTF-8 sequence: %q", path)