2020-04-23 19:39:20 +03:00
|
|
|
package json
|
|
|
|
|
2020-04-30 13:08:50 +03:00
|
|
|
var (
|
|
|
|
isWhiteSpace = [256]bool{}
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
isWhiteSpace[' '] = true
|
|
|
|
isWhiteSpace['\n'] = true
|
|
|
|
isWhiteSpace['\t'] = true
|
|
|
|
isWhiteSpace['\r'] = true
|
|
|
|
}
|
|
|
|
|
2020-05-06 20:37:29 +03:00
|
|
|
func skipWhiteSpace(buf []byte, cursor int) int {
|
|
|
|
buflen := len(buf)
|
|
|
|
for ; cursor < buflen; cursor++ {
|
2020-04-30 13:08:50 +03:00
|
|
|
if isWhiteSpace[buf[cursor]] {
|
2020-04-23 19:39:20 +03:00
|
|
|
continue
|
|
|
|
}
|
|
|
|
return cursor
|
|
|
|
}
|
|
|
|
return buflen
|
|
|
|
}
|