mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
encoding/json: scanner: use byte, more consistent
The fields step and redoState of struct scanner are now defined as `func(s *scanner, c byte) int` instead of `func(s *scanner, c int) int`, since bytes are sufficient. Further changes improve the consistency in the scanner.go file. Change-Id: Ifb85f2130d728d2b936d79914d87a1f0b5c6ee7d Reviewed-on: https://go-review.googlesource.com/14801 Reviewed-by: Andrew Gerrand <adg@golang.org> Run-TryBot: Andrew Gerrand <adg@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
6d0178359f
commit
fcf8143d63
5 changed files with 55 additions and 62 deletions
|
|
@ -241,7 +241,7 @@ func (d *decodeState) scanWhile(op int) int {
|
|||
newOp = d.scan.eof()
|
||||
d.off = len(d.data) + 1 // mark processed EOF with len+1
|
||||
} else {
|
||||
c := int(d.data[d.off])
|
||||
c := d.data[d.off]
|
||||
d.off++
|
||||
newOp = d.scan.step(&d.scan, c)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue