Refactor isWhiteSpace at streaming decoding

This commit is contained in:
Masaaki Goshima 2021-02-06 20:08:18 +09:00
parent 0c1e7c61e0
commit 6f972bcc9d
1 changed files with 3 additions and 3 deletions

View File

@ -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
} }