aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/fix
diff options
context:
space:
mode:
authorMarvin Stenger <marvin.stenger94@gmail.com>2017-10-05 15:49:32 +0200
committerIan Lance Taylor <iant@golang.org>2017-10-05 23:19:10 +0000
commit90d71fe99e21b68e292327c966946f1706d66514 (patch)
tree1eb63d7ee1c5bf5be76b5a69364416603597f573 /src/cmd/fix
parent7e31d9b9f7e8e4e72472cfcbd807b5672806635a (diff)
downloadgo-90d71fe99e21b68e292327c966946f1706d66514.tar.gz
go-90d71fe99e21b68e292327c966946f1706d66514.zip
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>
Diffstat (limited to 'src/cmd/fix')
-rw-r--r--src/cmd/fix/fix.go2
-rw-r--r--src/cmd/fix/typecheck.go6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/cmd/fix/fix.go b/src/cmd/fix/fix.go
index f12d1c7fe0..ebed82fbeb 100644
--- a/src/cmd/fix/fix.go
+++ b/src/cmd/fix/fix.go
@@ -791,7 +791,7 @@ func renameFix(tab []rename) func(*ast.File) bool {
}
func parseName(s string) (ptr bool, pkg, nam string) {
- i := strings.IndexByte(s, '.')
+ i := strings.Index(s, ".")
if i < 0 {
panic("parseName: invalid name " + s)
}
diff --git a/src/cmd/fix/typecheck.go b/src/cmd/fix/typecheck.go
index e2b89edc7d..0352c49db0 100644
--- a/src/cmd/fix/typecheck.go
+++ b/src/cmd/fix/typecheck.go
@@ -471,7 +471,7 @@ func typecheck1(cfg *TypeConfig, f interface{}, typeof map[interface{}]string, a
if strings.HasPrefix(t, "[") || strings.HasPrefix(t, "map[") {
// Lazy: assume there are no nested [] in the array
// length or map key type.
- if i := strings.IndexByte(t, ']'); i >= 0 {
+ if i := strings.Index(t, "]"); i >= 0 {
typeof[n] = t[i+1:]
}
}
@@ -512,11 +512,11 @@ func typecheck1(cfg *TypeConfig, f interface{}, typeof map[interface{}]string, a
key, value = "int", "rune"
} else if strings.HasPrefix(t, "[") {
key = "int"
- if i := strings.IndexByte(t, ']'); i >= 0 {
+ if i := strings.Index(t, "]"); i >= 0 {
value = t[i+1:]
}
} else if strings.HasPrefix(t, "map[") {
- if i := strings.IndexByte(t, ']'); i >= 0 {
+ if i := strings.Index(t, "]"); i >= 0 {
key, value = t[4:i], t[i+1:]
}
}