forked from mirror/go-json
Improve performance skipWhiteSpace
This commit is contained in:
parent
f198ef6517
commit
4201966ee1
|
@ -12,12 +12,10 @@ func init() {
|
|||
}
|
||||
|
||||
func skipWhiteSpace(buf []byte, cursor int) int {
|
||||
buflen := len(buf)
|
||||
for ; cursor < buflen; cursor++ {
|
||||
if isWhiteSpace[buf[cursor]] {
|
||||
continue
|
||||
}
|
||||
return cursor
|
||||
LOOP:
|
||||
if isWhiteSpace[buf[cursor]] {
|
||||
cursor++
|
||||
goto LOOP
|
||||
}
|
||||
return buflen
|
||||
return cursor
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue