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/regexp | |
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/regexp')
-rw-r--r-- | src/regexp/exec_test.go | 4 | ||||
-rw-r--r-- | src/regexp/regexp.go | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/regexp/exec_test.go b/src/regexp/exec_test.go index 5b827a528d..5f8e747b17 100644 --- a/src/regexp/exec_test.go +++ b/src/regexp/exec_test.go @@ -294,7 +294,7 @@ func parseResult(t *testing.T, file string, lineno int, res string) []int { out[n] = -1 out[n+1] = -1 } else { - k := strings.IndexByte(pair, '-') + k := strings.Index(pair, "-") if k < 0 { t.Fatalf("%s:%d: invalid pair %s", file, lineno, pair) } @@ -457,7 +457,7 @@ Reading: continue Reading } case ':': - i := strings.IndexByte(flag[1:], ':') + i := strings.Index(flag[1:], ":") if i < 0 { t.Logf("skip: %s", line) continue Reading diff --git a/src/regexp/regexp.go b/src/regexp/regexp.go index f8643e5a54..b1af23e850 100644 --- a/src/regexp/regexp.go +++ b/src/regexp/regexp.go @@ -829,7 +829,7 @@ func (re *Regexp) ExpandString(dst []byte, template string, src string, match [] func (re *Regexp) expand(dst []byte, template string, bsrc []byte, src string, match []int) []byte { for len(template) > 0 { - i := strings.IndexByte(template, '$') + i := strings.Index(template, "$") if i < 0 { break } |