Commit 9f193fbe authored by Gabriel Aszalos's avatar Gabriel Aszalos Committed by Brad Fitzpatrick

encoding/json: use isSpace in stateEndTop

This change makes stateEndTop use isSpace instead of specifically
recreating the same functionality.

Change-Id: I81f8f51682e46e7f8e2b9fed423a968457200625
Reviewed-on: https://go-review.googlesource.com/c/121797Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 8aee193f
......@@ -289,7 +289,7 @@ func stateEndValue(s *scanner, c byte) int {
// such as after reading `{}` or `[1,2,3]`.
// Only space characters should be seen now.
func stateEndTop(s *scanner, c byte) int {
if c != ' ' && c != '\t' && c != '\r' && c != '\n' {
if !isSpace(c) {
// Complain about non-space byte on next call.
s.error(c, "after top-level value")
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment