all: revert "all: prefer strings.IndexByte over strings.Index"

This reverts https://golang.org/cl/65930.

Fixes #22148

Change-Id: Ie0712621ed89c43bef94417fc32de9af77607760
Reviewed-on: https://go-review.googlesource.com/68430
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Marvin Stenger 2017-10-05 15:49:32 +02:00 committed by Ian Lance Taylor
parent 7e31d9b9f7
commit 90d71fe99e
55 changed files with 81 additions and 81 deletions

View file

@ -364,7 +364,7 @@ func Main(archInit func(*Arch)) {
// _ in phase name also matches space
phase := name[4:]
flag := "debug" // default flag is debug
if i := strings.IndexByte(phase, '/'); i >= 0 {
if i := strings.Index(phase, "/"); i >= 0 {
flag = phase[i+1:]
phase = phase[:i]
}
@ -689,7 +689,7 @@ func addImportMap(s string) {
if strings.Count(s, "=") != 1 {
log.Fatal("-importmap argument must be of the form source=actual")
}
i := strings.IndexByte(s, '=')
i := strings.Index(s, "=")
source, actual := s[:i], s[i+1:]
if source == "" || actual == "" {
log.Fatal("-importmap argument must be of the form source=actual; source and actual must be non-empty")
@ -712,13 +712,13 @@ func readImportCfg(file string) {
}
var verb, args string
if i := strings.IndexByte(line, ' '); i < 0 {
if i := strings.Index(line, " "); i < 0 {
verb = line
} else {
verb, args = line[:i], strings.TrimSpace(line[i+1:])
}
var before, after string
if i := strings.IndexByte(args, '='); i >= 0 {
if i := strings.Index(args, "="); i >= 0 {
before, after = args[:i], args[i+1:]
}
switch verb {