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:
Russ Cox 2009-05-11 14:10:34 -07:00
parent 5a11a46e2d
commit 3619f1ea6a
11 changed files with 121 additions and 119 deletions

View file

@ -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];