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 {
|
func skipWhiteSpace(buf []byte, cursor int) int {
|
||||||
buflen := len(buf)
|
LOOP:
|
||||||
for ; cursor < buflen; cursor++ {
|
|
||||||
if isWhiteSpace[buf[cursor]] {
|
if isWhiteSpace[buf[cursor]] {
|
||||||
continue
|
cursor++
|
||||||
|
goto LOOP
|
||||||
}
|
}
|
||||||
return cursor
|
return cursor
|
||||||
}
|
}
|
||||||
return buflen
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue