Improve performance skipWhiteSpace

This commit is contained in:
Masaaki Goshima 2020-05-07 13:44:41 +09:00
parent f198ef6517
commit 4201966ee1
1 changed files with 5 additions and 7 deletions

View File

@ -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
}