From 6f972bcc9dcf06988783fd9e065e4b026e8712cc Mon Sep 17 00:00:00 2001 From: Masaaki Goshima Date: Sat, 6 Feb 2021 20:08:18 +0900 Subject: [PATCH] Refactor isWhiteSpace at streaming decoding --- decode_stream.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/decode_stream.go b/decode_stream.go index 9907505..561de91 100644 --- a/decode_stream.go +++ b/decode_stream.go @@ -85,11 +85,11 @@ func (s *stream) read() bool { func (s *stream) skipWhiteSpace() { LOOP: - c := s.char() - if isWhiteSpace[c] { + switch s.char() { + case ' ', '\n', '\t', '\r': s.cursor++ goto LOOP - } else if c == nul { + case nul: if s.read() { goto LOOP }