diff options
author | Marvin Stenger <marvin.stenger94@gmail.com> | 2017-10-05 15:49:32 +0200 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2017-10-05 23:19:10 +0000 |
commit | 90d71fe99e21b68e292327c966946f1706d66514 (patch) | |
tree | 1eb63d7ee1c5bf5be76b5a69364416603597f573 /src/mime | |
parent | 7e31d9b9f7e8e4e72472cfcbd807b5672806635a (diff) | |
download | go-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/mime')
-rw-r--r-- | src/mime/encodedword.go | 2 | ||||
-rw-r--r-- | src/mime/mediatype.go | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/mime/encodedword.go b/src/mime/encodedword.go index bb49d65873..99eb432f54 100644 --- a/src/mime/encodedword.go +++ b/src/mime/encodedword.go @@ -257,7 +257,7 @@ func (d *WordDecoder) DecodeHeader(header string) (string, error) { } cur := start + len("=?") - i := strings.IndexByte(header[cur:], '?') + i := strings.Index(header[cur:], "?") if i == -1 { break } diff --git a/src/mime/mediatype.go b/src/mime/mediatype.go index 7ec67cd584..b8a83d6f79 100644 --- a/src/mime/mediatype.go +++ b/src/mime/mediatype.go @@ -20,7 +20,7 @@ import ( // FormatMediaType returns the empty string. func FormatMediaType(t string, param map[string]string) string { var b bytes.Buffer - if slash := strings.IndexByte(t, '/'); slash == -1 { + if slash := strings.Index(t, "/"); slash == -1 { if !isToken(t) { return "" } @@ -110,7 +110,7 @@ var ErrInvalidMediaParameter = errors.New("mime: invalid media parameter") // The returned map, params, maps from the lowercase // attribute to the attribute value with its case preserved. func ParseMediaType(v string) (mediatype string, params map[string]string, err error) { - i := strings.IndexByte(v, ';') + i := strings.Index(v, ";") if i == -1 { i = len(v) } @@ -146,7 +146,7 @@ func ParseMediaType(v string) (mediatype string, params map[string]string, err e } pmap := params - if idx := strings.IndexByte(key, '*'); idx != -1 { + if idx := strings.Index(key, "*"); idx != -1 { baseName := key[:idx] if continuation == nil { continuation = make(map[string]map[string]string) |