diff options
| author | Gabriel Aszalos <gabriel.aszalos@gmail.com> | 2018-06-30 18:12:24 +0200 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2018-10-06 15:40:02 +0000 |
| commit | 9f193fbe31d7ffa5f6e71a6387cbcf4636306660 (patch) | |
| tree | 3b9f4d9ce3bf246519de8a2ea1bca3c52103871b /src/encoding/json | |
| parent | 8aee193fb8b61d474a7e3e6d43625f4e746c5b65 (diff) | |
| download | go-9f193fbe31d7ffa5f6e71a6387cbcf4636306660.tar.xz | |
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/121797
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/encoding/json')
| -rw-r--r-- | src/encoding/json/scanner.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/encoding/json/scanner.go b/src/encoding/json/scanner.go index 9e6d482e16..88572245fc 100644 --- a/src/encoding/json/scanner.go +++ b/src/encoding/json/scanner.go @@ -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") } |
