mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
change utf8.FullRuneInString and utf8.DecodeRuneInString
to use single string argument instead of string, index. R=r DELTA=136 (9 added, 7 deleted, 120 changed) OCL=28642 CL=28644
This commit is contained in:
parent
5a11a46e2d
commit
3619f1ea6a
11 changed files with 121 additions and 119 deletions
|
|
@ -263,7 +263,7 @@ func (p *parser) nextc() int {
|
|||
if p.pos >= len(p.re.expr) {
|
||||
p.ch = endOfFile
|
||||
} else {
|
||||
c, w := utf8.DecodeRuneInString(p.re.expr, p.pos);
|
||||
c, w := utf8.DecodeRuneInString(p.re.expr[p.pos:len(p.re.expr)]);
|
||||
p.ch = c;
|
||||
p.pos += w;
|
||||
}
|
||||
|
|
@ -653,7 +653,7 @@ func (re *Regexp) doExecute(str string, pos int) []int {
|
|||
charwidth := 1;
|
||||
c := endOfFile;
|
||||
if pos < len(str) {
|
||||
c, charwidth = utf8.DecodeRuneInString(str, pos);
|
||||
c, charwidth = utf8.DecodeRuneInString(str[pos:len(str)]);
|
||||
}
|
||||
for i := 0; i < len(s[in]); i++ {
|
||||
st := s[in][i];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue