Change-Id: I32944f4ed519419e168e62f9ed6df63961839259
Reviewed-on: https://go-review.googlesource.com/c/go/+/359197
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Emmanuel Odeke <emmanuel@orijtech.com>
Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
accept = false
}
var width int
- // TODO: use step()
if b == nil {
- _, width = utf8.DecodeRuneInString(s[pos:end])
+ is := inputString{str: s}
+ _, width = is.step(pos)
} else {
- _, width = utf8.DecodeRune(b[pos:end])
+ ib := inputBytes{str: b}
+ _, width = ib.step(pos)
}
if width > 0 {
pos += width