mirror of https://github.com/goccy/go-json.git
Refactor isWhiteSpace at streaming decoding
This commit is contained in:
parent
0c1e7c61e0
commit
6f972bcc9d
|
@ -85,11 +85,11 @@ func (s *stream) read() bool {
|
||||||
|
|
||||||
func (s *stream) skipWhiteSpace() {
|
func (s *stream) skipWhiteSpace() {
|
||||||
LOOP:
|
LOOP:
|
||||||
c := s.char()
|
switch s.char() {
|
||||||
if isWhiteSpace[c] {
|
case ' ', '\n', '\t', '\r':
|
||||||
s.cursor++
|
s.cursor++
|
||||||
goto LOOP
|
goto LOOP
|
||||||
} else if c == nul {
|
case nul:
|
||||||
if s.read() {
|
if s.read() {
|
||||||
goto LOOP
|
goto LOOP
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue